diff --git a/src/Storage.h b/src/Storage.h index 7d6f2ee162..5b4731914d 100644 --- a/src/Storage.h +++ b/src/Storage.h @@ -82,8 +82,10 @@ class Storage { ~Storage(); struct Update { - std::shared_ptr entry; enum Kind { kAssign, kValueUpdate, kFlagsUpdate, kDelete, kDeleteAll }; + Update(std::shared_ptr entry_, Kind kind_) + : entry(entry_), kind(kind_) {} + std::shared_ptr entry; Kind kind; }; typedef ConcurrentQueue UpdateQueue; @@ -117,9 +119,9 @@ class Storage { Storage(const Storage&) = delete; Storage& operator=(const Storage&) = delete; - void AddUpdate(std::shared_ptr entry, Update::Kind kind) { - if (m_updates_enabled) - m_updates.push(Update{entry, kind}); + template + void AddUpdate(Args&&... args) { + if (m_updates_enabled) m_updates.emplace(std::forward(args)...); } typedef llvm::StringMap> EntriesMap;