mirror of
https://framagit.org/ppom/reaction
synced 2026-03-14 12:45:47 +01:00
Tree::fetch_update: Do not remove and re-add entries.
Better cloning the value than writing another entry!
This commit is contained in:
parent
f4b5ed20ab
commit
10bd0a1859
2 changed files with 2 additions and 1 deletions
1
TODO
1
TODO
|
|
@ -6,3 +6,4 @@ should an ipv6-mapped ipv4 match a pattern of type ipv6?
|
|||
should it be normalized as ipv4 then?
|
||||
|
||||
fix filter commands executing before start commands
|
||||
fix order of db write subject to race condition (make writes async?)
|
||||
|
|
|
|||
|
|
@ -364,7 +364,7 @@ impl<K: KeyType, V: ValueType> Tree<K, V> {
|
|||
key: K,
|
||||
mut f: F,
|
||||
) -> Option<V> {
|
||||
let old_value = self.remove(&key);
|
||||
let old_value = self.get(&key).map(|v| v.to_owned());
|
||||
let new_value = f(old_value);
|
||||
self.log(&key, new_value.as_ref());
|
||||
if let Some(new_value) = new_value {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue