mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-20 10:35:50 +00:00
Rename canonicalize into two functions:
* canonicalize_replace_cache * canonicalize_replace_client Now it is clear at the call site that if there are duplicate copies of the data between the cache and the caller, which copy gets replaced. Additionally data parameter is now const-correct. If it is not going to be replaced (canonicalize_replace_cache), then the shared_ptr to the client data is const.
This commit is contained in:
committed by
manojsdoshi
parent
e257a226f3
commit
f22fcb3b2a
@@ -892,7 +892,7 @@ DatabaseShardImp::store(
|
||||
auto [backend, pCache, nCache] = shard->getBackendAll();
|
||||
auto nObj {NodeObject::createObject(type, std::move(data), hash)};
|
||||
|
||||
pCache->canonicalize(hash, nObj, true);
|
||||
pCache->canonicalize_replace_cache(hash, nObj);
|
||||
backend->store(nObj);
|
||||
nCache->erase(hash);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user