Swap operands instead of using !.

This avoids returning true for A == B.

Thanks to Benjamin Kramer for noticing it.

llvm-svn: 241490
This commit is contained in:
Rafael Espindola 2015-07-06 19:24:40 +00:00
parent 9c7a623015
commit cab827532e
1 changed files with 1 additions and 1 deletions

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