]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* include/backward/hashtable.h (clear): Return quickly if the
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Mar 2009 21:45:51 +0000 (21:45 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Mar 2009 21:45:51 +0000 (21:45 +0000)
table is empty.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145318 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/backward/hashtable.h

index 0c51edb7aafed80a99eb663b5987cafc32e78d78..6b47446215283923bd3352df6e73e9cdae9f0679 100644 (file)
@@ -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.
index c0981ee856547c2270dfadd66a517c262069c883..e0ba83b34f1b45120e0c480fbc121834f9981387 100644 (file)
@@ -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];