Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl<R: gimli::Reader> Functions<R> {
// It's possible for multiple functions to have the same address range if the
// compiler can detect and remove functions with identical code. In that case
// we'll nondeterministically return one of them.
addresses.sort_by_key(|x| x.range.begin);
addresses.sort_unstable_by_key(|x| x.range.begin);

Ok(Functions {
functions: functions.into_boxed_slice(),
Expand Down Expand Up @@ -252,7 +252,7 @@ impl<R: gimli::Reader> Function<R> {
// In this example, if you want to look up address 7 at depth 0, and you
// encounter [0..2 at depth 1], are you before or after the target range?
// You don't know.
state.addresses.sort_by(|r1, r2| {
state.addresses.sort_unstable_by(|r1, r2| {
if r1.call_depth < r2.call_depth {
Ordering::Less
} else if r1.call_depth > r2.call_depth {
Expand Down
2 changes: 1 addition & 1 deletion src/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl Lines {
column,
});
}
sequences.sort_by_key(|x| x.start);
sequences.sort_unstable_by_key(|x| x.start);

let mut files = Vec::new();
let header = rows.header();
Expand Down
4 changes: 2 additions & 2 deletions src/unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl<R: gimli::Reader> ResUnits<R> {
while let Some(header) = headers.next()? {
aranges.push((header.debug_info_offset(), header.offset()));
}
aranges.sort_by_key(|i| i.0);
aranges.sort_unstable_by_key(|i| i.0);

let mut unit_ranges = Vec::new();
let mut res_units = Vec::new();
Expand Down Expand Up @@ -362,7 +362,7 @@ impl<R: gimli::Reader> ResUnits<R> {
}

// Sort this for faster lookup in `Self::find_range`.
unit_ranges.sort_by_key(|i| i.range.end);
unit_ranges.sort_unstable_by_key(|i| (i.range.end, i.unit_id));

// Calculate the `min_begin` field now that we've determined the order of
// CUs.
Expand Down
Loading