From 06d5701e0b2dd184b5be9932c8f5e5a759a09d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Thu, 20 Feb 2025 13:29:04 +0100 Subject: [PATCH] src: move instead of copy shared pointer in node_blob Resolves a new warning reported by Coverity. PR-URL: https://github.com/nodejs/node/pull/57120 Reviewed-By: Marco Ippolito Reviewed-By: Yagiz Nizipli Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- src/node_blob.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_blob.cc b/src/node_blob.cc index bc17a5d3c20ee7..de38873d0b1c07 100644 --- a/src/node_blob.cc +++ b/src/node_blob.cc @@ -207,7 +207,7 @@ void Blob::New(const FunctionCallbackInfo& args) { return nullptr; } return DataQueue::CreateInMemoryEntryFromBackingStore( - store, byte_offset, byte_length); + std::move(store), byte_offset, byte_length); } // If the ArrayBuffer is not detachable, we will copy from it instead. @@ -216,7 +216,7 @@ void Blob::New(const FunctionCallbackInfo& args) { uint8_t* ptr = static_cast(buf->Data()) + byte_offset; std::copy(ptr, ptr + byte_length, static_cast(store->Data())); return DataQueue::CreateInMemoryEntryFromBackingStore( - store, 0, byte_length); + std::move(store), 0, byte_length); }; // Every entry should be either an ArrayBuffer, ArrayBufferView, or Blob.