Skip to content

Commit

Permalink
fix: address -Wpessimizing-move warning in binary blob helpers
Browse files Browse the repository at this point in the history
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()));
  • Loading branch information
addaleax committed Dec 12, 2024
1 parent ea49575 commit fa696e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export async function createCompressedBlobDefinition (fnName: string, source: Ui
function blobTypedArrayAccessors (fnName: string, sourceLength: number): string {
return `
std::shared_ptr<v8::BackingStore> ${fnName}BackingStore() {
std::vector<char>* str = new std::vector<char>(std::move(${fnName}Vector()));
std::vector<char>* str = new std::vector<char>(${fnName}Vector());
return v8::SharedArrayBuffer::NewBackingStore(
&str->front(),
str->size(),
Expand Down

0 comments on commit fa696e4

Please sign in to comment.