Skip to content
Snippets Groups Projects
Commit a5d29c90 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

op cache: optimize cache insertion

parent 989f32eb
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ bool
OpValueCache::onValuesAdded(const std::vector<Sp<Value>>& vals) {
std::vector<Sp<Value>> newValues;
for (const auto& v : vals) {
auto viop = values.emplace(v->id, OpCacheValueStorage{v});
auto viop = values.emplace(v->id, v);
if (viop.second) {
newValues.emplace_back(v);
} else {
......
......@@ -27,7 +27,7 @@ struct OpCacheValueStorage
{
Sp<Value> data {};
unsigned refCount {1};
OpCacheValueStorage(Sp<Value> val = {}) : data(val) {}
OpCacheValueStorage(Sp<Value> val) : data(val) {}
};
class OpValueCache {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment