@@ -91,16 +91,13 @@ pub struct PackageRegistry<'cfg> {
91
91
type LockedMap = HashMap <
92
92
// The first level of key-ing done in this hash map is the source that
93
93
// dependencies come from, identified by a `SourceId`.
94
- SourceId ,
95
- HashMap <
96
- // This next level is keyed by the name of the package...
97
- InternedString ,
98
- // ... and the value here is a list of tuples. The first element of each
99
- // tuple is a package which has the source/name used to get to this
100
- // point. The second element of each tuple is the list of locked
101
- // dependencies that the first element has.
102
- Vec < ( PackageId , Vec < PackageId > ) > ,
103
- > ,
94
+ // The next level is keyed by the name of the package...
95
+ ( SourceId , InternedString ) ,
96
+ // ... and the value here is a list of tuples. The first element of each
97
+ // tuple is a package which has the source/name used to get to this
98
+ // point. The second element of each tuple is the list of locked
99
+ // dependencies that the first element has.
100
+ Vec < ( PackageId , Vec < PackageId > ) > ,
104
101
> ;
105
102
106
103
#[ derive( PartialEq , Eq , Clone , Copy ) ]
@@ -203,11 +200,10 @@ impl<'cfg> PackageRegistry<'cfg> {
203
200
for dep in deps. iter ( ) {
204
201
trace ! ( "\t -> {}" , dep) ;
205
202
}
206
- let sub_map = self
203
+ let sub_vec = self
207
204
. locked
208
- . entry ( id. source_id ( ) )
209
- . or_insert_with ( HashMap :: new) ;
210
- let sub_vec = sub_map. entry ( id. name ( ) ) . or_insert_with ( Vec :: new) ;
205
+ . entry ( ( id. source_id ( ) , id. name ( ) ) )
206
+ . or_insert_with ( Vec :: new) ;
211
207
sub_vec. push ( ( id, deps) ) ;
212
208
}
213
209
@@ -637,8 +633,7 @@ fn lock(
637
633
summary : Summary ,
638
634
) -> Summary {
639
635
let pair = locked
640
- . get ( & summary. source_id ( ) )
641
- . and_then ( |map| map. get ( & summary. name ( ) ) )
636
+ . get ( & ( summary. source_id ( ) , summary. name ( ) ) )
642
637
. and_then ( |vec| vec. iter ( ) . find ( |& & ( id, _) | id == summary. package_id ( ) ) ) ;
643
638
644
639
trace ! ( "locking summary of {}" , summary. package_id( ) ) ;
@@ -727,8 +722,7 @@ fn lock(
727
722
// all known locked packages to see if they match this dependency.
728
723
// If anything does then we lock it to that and move on.
729
724
let v = locked
730
- . get ( & dep. source_id ( ) )
731
- . and_then ( |map| map. get ( & dep. package_name ( ) ) )
725
+ . get ( & ( dep. source_id ( ) , dep. package_name ( ) ) )
732
726
. and_then ( |vec| vec. iter ( ) . find ( |& & ( id, _) | dep. matches_id ( id) ) ) ;
733
727
if let Some ( & ( id, _) ) = v {
734
728
trace ! ( "\t second hit on {}" , id) ;
0 commit comments