mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
src: avoid copying BaseObjectPtrs in loop
While copying BaseObjectPtrs is cheap, it is not a no-op, so it is best to iterate over references to BaseObjectPtrs only. PR-URL: https://github.com/nodejs/node/pull/44270 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
a3ac445198
commit
d2dce59729
1 file changed
+1
-1
@@ -349,7 +349,7 @@ class SerializerDelegate : public ValueSerializer::Delegate {
|
||||
std::vector<BaseObjectPtr<BaseObject>> nested_transferables;
|
||||
if (!host_objects_[i]->NestedTransferables().To(&nested_transferables))
|
||||
return Nothing<bool>();
|
||||
for (auto nested_transferable : nested_transferables) {
|
||||
for (auto& nested_transferable : nested_transferables) {
|
||||
if (std::find(host_objects_.begin(),
|
||||
host_objects_.end(),
|
||||
nested_transferable) == host_objects_.end()) {
|
||||
|
||||
Reference in new issue
Block a user