mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-12-15 04:06:07 +00:00
Improve rstl::__insertion_sort, use in CScriptSpecialFunction
Former-commit-id: 714e3dea7e
This commit is contained in:
@@ -40,13 +40,10 @@ void __insertion_sort(It first, It last, Cmp cmp) {
|
||||
typename iterator_traits< It >::value_type value = *next;
|
||||
|
||||
It t1 = next;
|
||||
It t2 = next;
|
||||
while (first < t1 && cmp(value, *(t2 - 1))) {
|
||||
*t1 = *(t2 - 1);
|
||||
for (It t2 = next - 1; first < t1 && cmp(value, *t2); --t2) {
|
||||
*t1 = *t2;
|
||||
--t1;
|
||||
--t2;
|
||||
}
|
||||
|
||||
*t1 = value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user