Fix array bug.

This commit is contained in:
Stephen Chung
2021-12-22 22:22:20 +08:00
parent 3751b6d018
commit 5c31ec7f78
3 changed files with 32 additions and 21 deletions

View File

@@ -1110,9 +1110,9 @@ fn parse_switch(
value.hash(hasher);
let hash = hasher.finish();
if !table.contains_key(&hash) {
table.insert(hash, (condition.clone(), stmt.into()).into());
}
table
.entry(hash)
.or_insert_with(|| (condition.clone(), stmt.into()).into());
}
// Other range
_ => ranges.push((range.0, range.1, range.2, condition, stmt.into())),