Skip to content

Commit 3048581

Browse files
authored
fix: address -Wpessimizing-move warning in binary blob helpers (#62)
Fixes: ../src/node_main.cc:945:52: warning: moving a temporary object prevents copy elision std::vector<char>* str = new std::vector<char>(std::move(GetBoxednodeCodeCacheVector())); ^ ../src/node_main.cc:945:52: note: remove std::move call here std::vector<char>* str = new std::vector<char>(std::move(GetBoxednodeCodeCacheVector())); ^~~~~~~~~~ ~ ../src/node_main.cc:986:52: warning: moving a temporary object prevents copy elision std::vector<char>* str = new std::vector<char>(std::move(GetBoxednodeSnapshotBlobVector())); ^ ../src/node_main.cc:986:52: note: remove std::move call here std::vector<char>* str = new std::vector<char>(std::move(GetBoxednodeSnapshotBlobVector()));
1 parent ea49575 commit 3048581

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export async function createCompressedBlobDefinition (fnName: string, source: Ui
179179
function blobTypedArrayAccessors (fnName: string, sourceLength: number): string {
180180
return `
181181
std::shared_ptr<v8::BackingStore> ${fnName}BackingStore() {
182-
std::vector<char>* str = new std::vector<char>(std::move(${fnName}Vector()));
182+
std::vector<char>* str = new std::vector<char>(${fnName}Vector());
183183
return v8::SharedArrayBuffer::NewBackingStore(
184184
&str->front(),
185185
str->size(),

0 commit comments

Comments
 (0)