Skip to content

Commit 33c5555

Browse files
targosacidiney
authored andcommitted
src: move instead of copy shared pointer in node_blob
Resolves a new warning reported by Coverity. PR-URL: nodejs#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>
1 parent 28b8d5b commit 33c5555

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node_blob.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ void Blob::New(const FunctionCallbackInfo<Value>& args) {
207207
return nullptr;
208208
}
209209
return DataQueue::CreateInMemoryEntryFromBackingStore(
210-
store, byte_offset, byte_length);
210+
std::move(store), byte_offset, byte_length);
211211
}
212212

213213
// If the ArrayBuffer is not detachable, we will copy from it instead.
@@ -216,7 +216,7 @@ void Blob::New(const FunctionCallbackInfo<Value>& args) {
216216
uint8_t* ptr = static_cast<uint8_t*>(buf->Data()) + byte_offset;
217217
std::copy(ptr, ptr + byte_length, static_cast<uint8_t*>(store->Data()));
218218
return DataQueue::CreateInMemoryEntryFromBackingStore(
219-
store, 0, byte_length);
219+
std::move(store), 0, byte_length);
220220
};
221221

222222
// Every entry should be either an ArrayBuffer, ArrayBufferView, or Blob.

0 commit comments

Comments
 (0)