Skip to content

Commit f764be2

Browse files
tniessenrichardlau
authored andcommitted
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: #59472 Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent ce9d677 commit f764be2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/crypto/crypto_keys.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class KeyObjectData final : public MemoryRetainer {
129129
KeyObjectData(KeyType type,
130130
std::shared_ptr<Mutex> mutex,
131131
std::shared_ptr<Data> data)
132-
: key_type_(type), mutex_(mutex), data_(data) {}
132+
: key_type_(type), mutex_(std::move(mutex)), data_(std::move(data)) {}
133133
};
134134

135135
class KeyObjectHandle : public BaseObject {

0 commit comments

Comments
 (0)