hashtable.h (clear): Return quickly if the table is empty.
* include/backward/hashtable.h (clear): Return quickly if the table is empty. From-SVN: r145318
This commit is contained in:
parent
5a2df0fa12
commit
7db6438d78
|
@ -1,3 +1,8 @@
|
|||
2009-03-30 Ian Lance Taylor <iant@google.com>
|
||||
|
||||
* include/backward/hashtable.h (clear): Return quickly if the
|
||||
table is empty.
|
||||
|
||||
2009-03-27 Ian Lance Taylor <iant@google.com>
|
||||
|
||||
* include/backward/hashtable.h (_S_num_primes): Change to 29.
|
||||
|
|
|
@ -1076,6 +1076,9 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
|||
hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
|
||||
clear()
|
||||
{
|
||||
if (_M_num_elements == 0)
|
||||
return;
|
||||
|
||||
for (size_type __i = 0; __i < _M_buckets.size(); ++__i)
|
||||
{
|
||||
_Node* __cur = _M_buckets[__i];
|
||||
|
|
Loading…
Reference in New Issue