mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
src: move shared_ptr objects in KeyObjectData
Since copying `shared_ptr` may involve costly atomic operations, explicitly move both `shared_ptr` objects that are passed to the private KeyObjectData constructor. PR-URL: https://github.com/nodejs/node/pull/59472 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
parent
ceaead7c59
commit
80fb4fe2a2
|
|
@ -127,7 +127,7 @@ class KeyObjectData final : public MemoryRetainer {
|
|||
KeyObjectData(KeyType type,
|
||||
std::shared_ptr<Mutex> mutex,
|
||||
std::shared_ptr<Data> data)
|
||||
: key_type_(type), mutex_(mutex), data_(data) {}
|
||||
: key_type_(type), mutex_(std::move(mutex)), data_(std::move(data)) {}
|
||||
};
|
||||
|
||||
class KeyObjectHandle : public BaseObject {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user