loadDecls and loadExpr: needed_mods can have a lot of duplication
Summary
While debugging something in the linker modules I observed that the needed_mods
list in loadDecls
(and in loadExpr
too) can contain dozens of entries of the same module. My brief investigation suggests we should likely use a Set-like data structure because it would be more efficient (not have duplicates) and would better model its purpose, as its occurrences seem to be pretty list-agnostic (it doesn't look like these modules need to be ordered).