1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

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

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;