Skip to content

Commit

Permalink
fix: use sort unstable to reduce memory overhead
Browse files Browse the repository at this point in the history
  • Loading branch information
aochagavia committed Apr 25, 2024
1 parent 46acbe2 commit 35a6a41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/rattler_repodata_gateway/src/sparse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ fn deserialize_filename_and_raw_record<'d, D: Deserializer<'d>>(
//
// Since (in most cases) the repodata is already ordered by filename which does closely resemble
// ordering by package name this sort operation will most likely be very fast.
entries.sort_by(|(a, _), (b, _)| a.package.cmp(b.package));
entries.sort_unstable_by(|(a, _), (b, _)| a.package.cmp(b.package));

Ok(entries)
}
Expand Down

0 comments on commit 35a6a41

Please sign in to comment.