Skip to content

Commit 8d34355

Browse files
authored
change kvec_test to use push_back instead of reserve, closes attractivechaos#151
1 parent c588728 commit 8d34355

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

test/kvec_test.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ int main()
5353
t = clock();
5454
for (i = 0; i < M; ++i) {
5555
std::vector<int> array;
56-
array.reserve(N);
57-
for (j = 0; j < N; ++j) array[j] = j;
56+
for (j = 0; j < N; ++j) array.push_back(j);
5857
}
5958
printf("C++ vector, preallocated: %.3f sec\n",
6059
(float)(clock() - t) / CLOCKS_PER_SEC);

0 commit comments

Comments
 (0)