changeset 14780:f43f5b63ba6d draft

(svn r19368) -Codechange: Return early in AIAbstractList::SetValue(), if the value is not modified.
author frosch <frosch@openttd.org>
date Sun, 07 Mar 2010 17:38:40 +0000
parents 7e7acca9c232
children 7550a3af1a05
files src/ai/api/ai_abstractlist.cpp
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ai/api/ai_abstractlist.cpp
+++ b/src/ai/api/ai_abstractlist.cpp
@@ -476,6 +476,7 @@
 	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);