@@ -61,7 +61,7 @@ use profiles::CompilationProfiles;
6161use rayon:: prelude:: * ;
6262use semver:: { Version , VersionReq } ;
6363use std:: {
64- collections:: { BTreeSet , HashMap , HashSet , VecDeque } ,
64+ collections:: { BTreeMap , BTreeSet , HashMap , HashSet , VecDeque } ,
6565 io,
6666 path:: { Path , PathBuf } ,
6767} ;
@@ -684,7 +684,7 @@ impl<L: Language, D: ParsedSource<Language = L>> Graph<D> {
684684 fn get_input_node_versions < C : Compiler < Language = L > > (
685685 & self ,
686686 project : & Project < C , impl ArtifactOutput > ,
687- ) -> Result < HashMap < L , HashMap < Version , Vec < usize > > > > {
687+ ) -> Result < HashMap < L , BTreeMap < Version , Vec < usize > > > > {
688688 trace ! ( "resolving input node versions" ) ;
689689
690690 let mut resulted_nodes = HashMap :: new ( ) ;
@@ -716,7 +716,7 @@ impl<L: Language, D: ParsedSource<Language = L>> Graph<D> {
716716 }
717717
718718 // stores all versions and their nodes that can be compiled
719- let mut versioned_nodes = HashMap :: new ( ) ;
719+ let mut versioned_nodes = BTreeMap :: new ( ) ;
720720
721721 // stores all files and the versions they're compatible with
722722 let mut all_candidates = Vec :: with_capacity ( self . edges . num_input_files ) ;
@@ -800,17 +800,17 @@ impl<L: Language, D: ParsedSource<Language = L>> Graph<D> {
800800 fn resolve_profiles < ' a , C : Compiler < Language = L > , T : ArtifactOutput > (
801801 & self ,
802802 project : & ' a Project < C , T > ,
803- input_nodes_versions : HashMap < L , HashMap < Version , Vec < usize > > > ,
803+ input_nodes_versions : HashMap < L , BTreeMap < Version , Vec < usize > > > ,
804804 ) -> Result < (
805- HashMap < L , HashMap < Version , HashMap < usize , Vec < usize > > > > ,
805+ HashMap < L , BTreeMap < Version , BTreeMap < usize , Vec < usize > > > > ,
806806 CompilationProfiles < C :: Settings > ,
807807 ) > {
808808 let mut profiles = CompilationProfiles :: new ( project) ;
809809 let mut resulted_sources = HashMap :: new ( ) ;
810810 for ( language, versions) in input_nodes_versions {
811- let mut versioned_sources = HashMap :: new ( ) ;
811+ let mut versioned_sources = BTreeMap :: new ( ) ;
812812 for ( version, nodes) in versions {
813- let mut profile_to_nodes = HashMap :: new ( ) ;
813+ let mut profile_to_nodes = BTreeMap :: new ( ) ;
814814 for idx in nodes {
815815 let Some ( restrictions) = self . merge_restrictions ( idx, project) ? else {
816816 // If there are no restrictions on this node, use the first (default)
@@ -838,7 +838,7 @@ impl<L: Language, D: ParsedSource<Language = L>> Graph<D> {
838838 /// a high chance that the number of source files is <50, even for larger projects.
839839 fn resolve_multiple_versions (
840840 all_candidates : Vec < ( usize , HashSet < & CompilerVersion > ) > ,
841- ) -> HashMap < CompilerVersion , Vec < usize > > {
841+ ) -> BTreeMap < CompilerVersion , Vec < usize > > {
842842 // returns the intersection as sorted set of nodes
843843 fn intersection < ' a > (
844844 mut sets : Vec < & HashSet < & ' a CompilerVersion > > ,
@@ -879,11 +879,11 @@ impl<L: Language, D: ParsedSource<Language = L>> Graph<D> {
879879 let exact_version = remove_candidate ( & mut intersection) ;
880880 let all_nodes = all_candidates. into_iter ( ) . map ( |( node, _) | node) . collect ( ) ;
881881 trace ! ( "resolved solc version compatible with all sources \" {}\" " , exact_version) ;
882- return HashMap :: from ( [ ( exact_version, all_nodes) ] ) ;
882+ return BTreeMap :: from ( [ ( exact_version, all_nodes) ] ) ;
883883 }
884884
885885 // no version satisfies all nodes
886- let mut versioned_nodes: HashMap < _ , _ > = HashMap :: new ( ) ;
886+ let mut versioned_nodes = BTreeMap :: new ( ) ;
887887
888888 // try to minimize the set of versions, this is guaranteed to lead to `versioned_nodes.len()
889889 // > 1` as no solc version exists that can satisfy all sources
0 commit comments