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:
parent
d4590cefa1
commit
211af74690
1 changed files with 1 additions and 1 deletions
|
@ -175,7 +175,7 @@ namespace Maxsi
|
||||||
template <class Searchee> size_t Search(int (*searcher)(const T t, const Searchee searchee), const Searchee searchee)
|
template <class Searchee> size_t Search(int (*searcher)(const T t, const Searchee searchee), const Searchee searchee)
|
||||||
{
|
{
|
||||||
if ( !listused ) { return SIZE_MAX; }
|
if ( !listused ) { return SIZE_MAX; }
|
||||||
if ( flags & FLAG_SORTED ) { Sort(); }
|
if ( !(flags & FLAG_SORTED) ) { Sort(); }
|
||||||
|
|
||||||
size_t minindex = 0;
|
size_t minindex = 0;
|
||||||
size_t maxindex = listused-1;
|
size_t maxindex = listused-1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue