Skip to content

Commit

Permalink
change kvec_test to use push_back instead of reserve, closes attracti…
Browse files Browse the repository at this point in the history
  • Loading branch information
seanpquinn authored Nov 4, 2023
1 parent c588728 commit 8d34355
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions test/kvec_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ int main()
t = clock();
for (i = 0; i < M; ++i) {
std::vector<int> array;
array.reserve(N);
for (j = 0; j < N; ++j) array[j] = j;
for (j = 0; j < N; ++j) array.push_back(j);
}
printf("C++ vector, preallocated: %.3f sec\n",
(float)(clock() - t) / CLOCKS_PER_SEC);
Expand Down

0 comments on commit 8d34355

Please sign in to comment.