summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-03-07 17:38:40 +0000
committerfrosch <frosch@openttd.org>2010-03-07 17:38:40 +0000
commitf0de6366bac6857a85fe1677fb6703b8be187be4 (patch)
treea01eaf114fde2e589be21b2cbf33baffe327d517
parent5734683a39d95d010a74f5a78edd24eef1e71466 (diff)
downloadopenttd-f0de6366bac6857a85fe1677fb6703b8be187be4.tar.xz
(svn r19368) -Codechange: Return early in AIAbstractList::SetValue(), if the value is not modified.
-rw-r--r--src/ai/api/ai_abstractlist.cpp1
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);