]> granicus.if.org Git - taglib/commitdiff
Don't dereference the iterator before checking to make sure that we're not
authorScott Wheeler <wheeler@kde.org>
Fri, 14 Jan 2005 13:04:36 +0000 (13:04 +0000)
committerScott Wheeler <wheeler@kde.org>
Fri, 14 Jan 2005 13:04:36 +0000 (13:04 +0000)
at the end of the list.  Thanks to Gunnar Roth for catching this one.

BUG:96926

git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@378404 283d02a7-25f6-0310-bc7c-ecb5cbfe19da

toolkit/tlist.tcc

index e94b85a7110fb782e4a92fa21876d5cc2ae61ba2..ae3f9a220fd4d550969902493a179805b6cb4156 100644 (file)
@@ -141,7 +141,7 @@ void List<T>::sortedInsert(const T &value, bool unique)
 {
   detach();
   Iterator it = begin();
-  while(*it < value && it != end())
+  while(it != end() && *it < value)
     ++it;
   if(unique && it != end() && *it == value)
     return;