From: Scott Wheeler Date: Fri, 14 Jan 2005 13:04:36 +0000 (+0000) Subject: Don't dereference the iterator before checking to make sure that we're not X-Git-Tag: v1.5~296 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=af8b4c7291f144fb23896925e9c2371a63edd55d;p=taglib Don't dereference the iterator before checking to make sure that we're not 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 --- diff --git a/toolkit/tlist.tcc b/toolkit/tlist.tcc index e94b85a7..ae3f9a22 100644 --- a/toolkit/tlist.tcc +++ b/toolkit/tlist.tcc @@ -141,7 +141,7 @@ void List::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;