From af8b4c7291f144fb23896925e9c2371a63edd55d Mon Sep 17 00:00:00 2001 From: Scott Wheeler Date: Fri, 14 Jan 2005 13:04:36 +0000 Subject: [PATCH] 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 --- toolkit/tlist.tcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;