Skip to content

Commit

Permalink
Fix frame vector size (#62)
Browse files Browse the repository at this point in the history
`push_back` is replaced by direct indexing since `std::vector<uintptr_t> output(n);`
already creates a a vector with n elements (set to 0).
  • Loading branch information
nsavoire committed Nov 24, 2022
1 parent cc262eb commit c8cd16c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bindings/sample.cc
Expand Up @@ -30,7 +30,7 @@ std::vector<uintptr_t> MakeFrames(v8::Isolate* isolate) {
std::vector<uintptr_t> output(n);

for (size_t i = 0; i < n; i++) {
output.push_back(reinterpret_cast<uintptr_t>(frames[i]));
output[i] = reinterpret_cast<uintptr_t>(frames[i]);
}

return output;
Expand Down

0 comments on commit c8cd16c

Please sign in to comment.