Swap operands instead of using !.

This avoids returning true for A == B.

Thanks to Benjamin Kramer for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241490 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2015-07-06 19:24:40 +00:00
parent 40b3496f9a
commit 9c3967db0f

View File

@ -510,7 +510,7 @@ static void sortAndPrintSymbolList(SymbolicFile &Obj, bool printName,
Cmp = compareSymbolName;
if (ReverseSort)
Cmp = [=](const NMSymbol &A, const NMSymbol &B) { return !Cmp(A, B); };
Cmp = [=](const NMSymbol &A, const NMSymbol &B) { return Cmp(B, A); };
std::sort(SymbolList.begin(), SymbolList.end(), Cmp);
}