From f0de6366bac6857a85fe1677fb6703b8be187be4 Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 7 Mar 2010 17:38:40 +0000 Subject: (svn r19368) -Codechange: Return early in AIAbstractList::SetValue(), if the value is not modified. --- src/ai/api/ai_abstractlist.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/ai') 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); -- cgit v1.2.3-54-g00ecf