Skip to content

Commit

Permalink
fix: Switch from HashMap to BTreeMap in merge_stores (#2035)
Browse files Browse the repository at this point in the history
switch from hashMap to BTreeMap in merge_stores
  • Loading branch information
vezenovm authored Jul 25, 2023
1 parent c8f863a commit 4d179e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/noirc_evaluator/src/ssa_refactor/opt/flatten_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
//! v12 = add v10, v11
//! store v12 at v5 (new store)
use std::{
collections::{HashMap, HashSet},
collections::{HashMap, HashSet, BTreeMap},
rc::Rc,
};

Expand Down Expand Up @@ -610,7 +610,7 @@ impl<'f> Context<'f> {
/// this function also needs to be changed to reflect that.
fn merge_stores(&mut self, then_branch: Branch, else_branch: Branch) {
// Address -> (then_value, else_value, value_before_the_if)
let mut new_map = HashMap::with_capacity(then_branch.store_values.len());
let mut new_map = BTreeMap::new();

for (address, store) in then_branch.store_values {
new_map.insert(address, (store.new_value, store.old_value, store.old_value));
Expand Down

0 comments on commit 4d179e3

Please sign in to comment.