From 211af74690b2d2cfb93acf86d16ce7ec7594889e Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Mon, 21 Nov 2011 14:56:09 +0100 Subject: [PATCH] Fixed bug where SortedList::Search did not sort the list if needed. --- libmaxsi/hsrc/sortedlist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmaxsi/hsrc/sortedlist.h b/libmaxsi/hsrc/sortedlist.h index 68191f53..4d57e67f 100644 --- a/libmaxsi/hsrc/sortedlist.h +++ b/libmaxsi/hsrc/sortedlist.h @@ -175,7 +175,7 @@ namespace Maxsi template size_t Search(int (*searcher)(const T t, const Searchee searchee), const Searchee searchee) { if ( !listused ) { return SIZE_MAX; } - if ( flags & FLAG_SORTED ) { Sort(); } + if ( !(flags & FLAG_SORTED) ) { Sort(); } size_t minindex = 0; size_t maxindex = listused-1;