From: <ag...@us...> - 2011-11-18 18:38:00
|
Revision: 2611 http://zoolib.svn.sourceforge.net/zoolib/?rev=2611&view=rev Author: agreen Date: 2011-11-18 18:37:54 +0000 (Fri, 18 Nov 2011) Log Message: ----------- Don't need the temp copy of the iterator. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZUtil_STL_vector.h Modified: trunk/zoolib/source/cxx/zoolib/ZUtil_STL_vector.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZUtil_STL_vector.h 2011-11-17 14:49:46 UTC (rev 2610) +++ trunk/zoolib/source/cxx/zoolib/ZUtil_STL_vector.h 2011-11-18 18:37:54 UTC (rev 2611) @@ -56,8 +56,7 @@ template <typename Base, typename Derived> bool sPushBackIfNotContains(std::vector<Base>& ioVec, const Derived& iElement) { - typename std::vector<Base>::iterator i = std::find(ioVec.begin(), ioVec.end(), iElement); - if (i != ioVec.end()) + if (ioVec.end() == std::find(ioVec.begin(), ioVec.end(), iElement)) return false; ioVec.push_back(iElement); return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |