Skip to content

Commit

Permalink
fix determinism bug using indexmap
Browse files Browse the repository at this point in the history
  • Loading branch information
oflatt committed Aug 6, 2024
1 parent ecc3be5 commit 3847871
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl Display for Id {
#[derive(Clone, Debug)]
/// The egglog internal representation of already compiled rules
pub(crate) enum Ruleset {
Rules(Symbol, HashMap<Symbol, CompiledRule>),
Rules(Symbol, IndexMap<Symbol, CompiledRule>),
Combined(Symbol, Vec<Symbol>),
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1100,8 +1100,8 @@ impl EGraph {
match rules {
Ruleset::Rules(_, rules) => {
match rules.entry(name) {
Entry::Occupied(_) => panic!("Rule '{name}' was already present"),
Entry::Vacant(e) => e.insert(compiled_rule),
indexmap::map::Entry::Occupied(_) => panic!("Rule '{name}' was already present"),
indexmap::map::Entry::Vacant(e) => e.insert(compiled_rule),
};
Ok(name)
}
Expand Down

0 comments on commit 3847871

Please sign in to comment.