ALL: Synced with ScummVM

This commit is contained in:
Pawel Kolodziejski 2015-12-22 00:24:01 +01:00
parent d4b7b14c09
commit 2fadf2e466
77 changed files with 2030 additions and 1020 deletions

View file

@ -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;
}