diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-05-22 13:10:27 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-05-22 13:10:48 +0200 |
| commit | 3d83960322e1a2053f2e6ef64cf5139b0b04cb47 (patch) | |
| tree | 86f4fbcf1ab807616ec4316badaf6c122b04751e /src | |
| parent | 08870d4a4c3890b9e36c67c8972e41f6af1e0042 (diff) | |
Fix removal order for dictionary
Switches to `shift_remove` for now. In the future, we should look into a more efficient implementation. Fixes #1258.
Diffstat (limited to 'src')
| -rw-r--r-- | src/eval/dict.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/eval/dict.rs b/src/eval/dict.rs index 1b28a6ba..49a60147 100644 --- a/src/eval/dict.rs +++ b/src/eval/dict.rs @@ -88,7 +88,7 @@ impl Dict { /// Remove a mapping by `key` and return the value. pub fn remove(&mut self, key: &str) -> StrResult<Value> { - match Arc::make_mut(&mut self.0).remove(key) { + match Arc::make_mut(&mut self.0).shift_remove(key) { Some(value) => Ok(value), None => Err(missing_key(key)), } |
