ALL: Synced with ScummVM
This commit is contained in:
parent
d4b7b14c09
commit
2fadf2e466
77 changed files with 2030 additions and 1020 deletions
|
@ -177,7 +177,8 @@ T sortChoosePivot(T first, T last) {
|
|||
template<typename T, class StrictWeakOrdering>
|
||||
T sortPartition(T first, T last, T pivot, StrictWeakOrdering &comp) {
|
||||
--last;
|
||||
SWAP(*pivot, *last);
|
||||
if (pivot != last)
|
||||
SWAP(*pivot, *last);
|
||||
|
||||
T sorted;
|
||||
for (sorted = first; first != last; ++first) {
|
||||
|
@ -188,7 +189,8 @@ T sortPartition(T first, T last, T pivot, StrictWeakOrdering &comp) {
|
|||
}
|
||||
}
|
||||
|
||||
SWAP(*last, *sorted);
|
||||
if (last != sorted)
|
||||
SWAP(*last, *sorted);
|
||||
return sorted;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue