allocator_thread.cc (do_loop): Don't use clear, but instead assign.

2004-01-30  Felix Yen  <fwy@alumni.brown.edu>

	* testsuite/performance/20_util/allocator_thread.cc (do_loop):
	Don't use clear, but instead assign. Use insert.

From-SVN: r76979
This commit is contained in:
Felix Yen 2004-01-30 18:14:42 +00:00 committed by Benjamin Kosnik
parent c9732ce7d5
commit 7b1d1edf99
2 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2004-01-30 Felix Yen <fwy@alumni.brown.edu>
* testsuite/performance/20_util/allocator_thread.cc (do_loop):
Don't use clear, but instead assign. Use insert.
2004-01-30 Benjamin Kosnik <bkoz@redhat.com>
* src/demangle.cc: Add instantiations.

View file

@ -73,15 +73,16 @@ template<typename Container>
while (test_iterations < iterations)
{
for (int j = 0; j < insert_values; ++j)
obj.push_back(test_iterations);
obj.insert(obj.begin(), test_iterations);
++test_iterations;
}
obj.clear();
// NB: Don't use clear() here, instead force deallocation.
obj = Container();
test_iterations = 0;
while (test_iterations < iterations)
{
for (int j = 0; j < insert_values; ++j)
obj.push_back(test_iterations);
obj.insert(obj.begin(), test_iterations);
++test_iterations;
}
}