diff options
author | frosch <frosch@openttd.org> | 2010-03-07 17:38:40 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2010-03-07 17:38:40 +0000 |
commit | f0de6366bac6857a85fe1677fb6703b8be187be4 (patch) | |
tree | a01eaf114fde2e589be21b2cbf33baffe327d517 /src/ai | |
parent | 5734683a39d95d010a74f5a78edd24eef1e71466 (diff) | |
download | openttd-f0de6366bac6857a85fe1677fb6703b8be187be4.tar.xz |
(svn r19368) -Codechange: Return early in AIAbstractList::SetValue(), if the value is not modified.
Diffstat (limited to 'src/ai')
-rw-r--r-- | src/ai/api/ai_abstractlist.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ai/api/ai_abstractlist.cpp b/src/ai/api/ai_abstractlist.cpp index d18010a10..ec2b7d4f5 100644 --- a/src/ai/api/ai_abstractlist.cpp +++ b/src/ai/api/ai_abstractlist.cpp @@ -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); |