Fixed bug where SortedList::Search did not sort the list if needed.

This commit is contained in:
Jonas 'Sortie' Termansen 2011-11-21 14:56:09 +01:00
parent d4590cefa1
commit 211af74690
1 changed files with 1 additions and 1 deletions

View File

@ -175,7 +175,7 @@ namespace Maxsi
template <class Searchee> 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;