Skip to content

Commit

Permalink
feat(snapshot): sort selectors ascending (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
iankressin authored Nov 19, 2023
1 parent c458847 commit 62a2ba0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/snapshot/util/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ pub fn build_rows(state: &mut State, max_row_height: usize) -> Vec<Row<'static>>
false => snapshots.len() - num_items..snapshots.len(),
};

let mut sorted_snapshots = snapshots[indices].to_vec();
sorted_snapshots.sort_by(|a, b| a.selector.cmp(&b.selector));

// slice storage_iter
for (i, snapshot) in snapshots[indices].iter().enumerate() {
for (i, snapshot) in sorted_snapshots.iter().enumerate() {
rows.push(
Row::new(vec![Cell::from(format!(" 0x{} ", snapshot.selector))])
.style(if snapshots.len() - state.function_index < num_items {
Expand Down

0 comments on commit 62a2ba0

Please sign in to comment.