Skip to content

Commit c244bf2

Browse files
committed
convert first
1 parent a89cb56 commit c244bf2

File tree

1 file changed

+5
-5
lines changed
  • turbopack/crates/turbo-tasks-auto-hash-map/src

1 file changed

+5
-5
lines changed

turbopack/crates/turbo-tasks-auto-hash-map/src/map.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -908,14 +908,14 @@ where
908908
H: BuildHasher + Default,
909909
{
910910
fn shrink_to_fit(&mut self) {
911+
if self.len() < MIN_HASH_SIZE {
912+
self.convert_to_list();
913+
}
914+
911915
match self {
912916
AutoMap::List(list) => list.shrink_to_fit(),
913917
AutoMap::Map(map) => {
914-
if map.len() < MIN_HASH_SIZE {
915-
self.convert_to_list();
916-
} else {
917-
hashbrown::HashMap::shrink_to_fit(map);
918-
}
918+
hashbrown::HashMap::shrink_to_fit(map);
919919
}
920920
}
921921
}

0 commit comments

Comments
 (0)