fix(merge): optimize key handling in deep_merge function

This commit is contained in:
Tunglies 2026-03-28 01:53:02 +08:00
parent 4ee6402e29
commit 857392de8a
No known key found for this signature in database
GPG Key ID: B9B01B389469B3E8

View File

@ -7,7 +7,7 @@ fn deep_merge(a: &mut Value, b: Value) {
match (a, b) {
(&mut Value::Mapping(ref mut a), Value::Mapping(b)) => {
for (k, v) in b {
deep_merge(a.entry(k.clone()).or_insert(Value::Null), v);
deep_merge(a.entry(k).or_insert(Value::Null), v);
}
}
(a, b) => *a = b,