Skip to content

Commit 7134592

Browse files
author
David Orchard
committed
Preserve map order when merging
1 parent f14adeb commit 7134592

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/path/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,11 @@ impl Expression {
209209
_ => {
210210
if let ValueKind::Table(ref mut map) = root.kind {
211211
// Just do a simple set
212-
map.insert(id.clone(), value);
212+
if let Some(existing) = map.get_mut(id) {
213+
*existing = value;
214+
} else {
215+
map.insert(id.clone(), value);
216+
}
213217
}
214218
}
215219
}

0 commit comments

Comments
 (0)