GT-3261: Improving sort

This commit is contained in:
Ryan Kurtz 2019-11-27 08:51:58 -05:00
parent 83f81e55d9
commit 370e909a55
2 changed files with 4 additions and 4 deletions

View File

@ -86,8 +86,8 @@ public class SymbolTableCommand extends LoadCommand {
// sort the entries by the index in the string table, so don't jump around reading
List<NList> sortedList = nlistList
.stream()
.sorted((o1, o2) -> Integer.valueOf(o1.getStringTableIndex())
.compareTo(Integer.valueOf(o2.getStringTableIndex())))
.sorted(
(o1, o2) -> Integer.compare(o1.getStringTableIndex(), o2.getStringTableIndex()))
.collect(Collectors.toList());
// initialize the NList strings from string table

View File

@ -161,8 +161,8 @@ public class DyldCacheLocalSymbolsInfo implements StructConverter {
// sort the entries by the index in the string table, so don't jump around reading
List<NList> sortedList = nlistList
.stream()
.sorted((o1, o2) -> Integer.valueOf(o1.getStringTableIndex())
.compareTo(Integer.valueOf(o2.getStringTableIndex())))
.sorted((o1, o2) -> Integer.compare(o1.getStringTableIndex(),
o2.getStringTableIndex()))
.collect(Collectors.toList());
// initialize the NList strings from string table