mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r19368) -Codechange: Return early in AIAbstractList::SetValue(), if the value is not modified.
This commit is contained in:
parent
5734683a39
commit
f0de6366ba
|
@ -476,6 +476,7 @@ bool AIAbstractList::SetValue(int32 item, int32 value)
|
|||
if (!this->HasItem(item)) return false;
|
||||
|
||||
int32 value_old = this->GetValue(item);
|
||||
if (value_old == value) return true;
|
||||
|
||||
this->sorter->Remove(item);
|
||||
this->buckets[value_old].erase(item);
|
||||
|
|
Loading…
Reference in New Issue