Skip to content

Commit

Permalink
src: move instead of copy shared pointer in node_blob
Browse files Browse the repository at this point in the history
Resolves a new warning reported by Coverity.

PR-URL: #57120
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
targos committed Feb 25, 2025
1 parent fdc8aeb commit 7dd326e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node_blob.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void Blob::New(const FunctionCallbackInfo<Value>& 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.
Expand All @@ -216,7 +216,7 @@ void Blob::New(const FunctionCallbackInfo<Value>& args) {
uint8_t* ptr = static_cast<uint8_t*>(buf->Data()) + byte_offset;
std::copy(ptr, ptr + byte_length, static_cast<uint8_t*>(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.
Expand Down

0 comments on commit 7dd326e

Please # to comment.