Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public Result check(BibDatabaseContext bibContext, BiConsumer<Integer, Integer>
entryTypeDefinitions = BibtexEntryTypeDefinitions.ALL;
}

// Use LinkedHashMap to preserve the order of Bib*EntryTypeDefinitions.ALL
// Use LinkedHashMap to preserve the order of Bib(tex|latex)EntryTypeDefinitions.ALL
Map<EntryType, EntryTypeResult> resultMap = new LinkedHashMap<>();

int counter = 0;
Expand Down Expand Up @@ -195,7 +195,7 @@ private static void collectEntriesIntoMaps(BibDatabaseContext bibContext, Map<En
}

entryTypeToEntriesMap
.computeIfAbsent(entryType, _ -> new java.util.LinkedHashSet<>())
.computeIfAbsent(entryType, _ -> new HashSet<>())
Copy link
Member

@Siedlerchr Siedlerchr Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LInkedHashSet preserves insertion order

Copy link
Member Author

@subhramit subhramit Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but isn't a sort happening later anyway at

List<BibEntry> sortedEntries = filterAndSortEntriesWithFieldDifferences(entries, differingFields, requiredFields);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LInkedHashSet preserves insertion order

Therefore, I a) read the code, thought through and b) relied in the test cases (which I also checked)

.add(entry);
}
}
Expand Down