Only run SharedCow::to_mut once

Peeping at the `cargo asm` output that this can't be elided due to side
effects of the atomic reads, so lifting it manually should save us some
extra work.
This commit is contained in:
sholderbach 2024-08-02 23:38:43 +02:00
parent e62356f5ec
commit 4d81d367fe

View File

@ -102,12 +102,13 @@ fn default(
val: ref mut record,
..
} => {
if let Some(val) = record.to_mut().get_mut(&column.item) {
let record = record.to_mut();
if let Some(val) = record.get_mut(&column.item) {
if matches!(val, Value::Nothing { .. }) {
*val = value.clone();
}
} else {
record.to_mut().push(column.item.clone(), value.clone());
record.push(column.item.clone(), value.clone());
}
item