mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Core: Developing SortedIndex
git-svn-id: svn://ultimatepp.org/upp/trunk@5793 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
b59e9959ed
commit
2fdf67af4f
3 changed files with 17 additions and 10 deletions
|
|
@ -725,9 +725,9 @@ template <class T, class Less>
|
|||
int SortedIndex<T, Less>::FindAdd(const T& key)
|
||||
{
|
||||
int i = FindLowerBound(key);
|
||||
if(!less(key, iv[i]))
|
||||
return i;
|
||||
return Add(key);
|
||||
if(i == GetCount() || less(key, iv[i]))
|
||||
iv.Insert(i, key);
|
||||
return i;
|
||||
}
|
||||
|
||||
template <class T, class Less>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue