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 <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
targos authored Feb 20, 2025
1 parent 867a754 commit 06d5701
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 06d5701

Please sign in to comment.