Fixed a bug in erase_at()
authorkhizmax <libcds.dev@gmail.com>
Mon, 14 Mar 2016 20:17:10 +0000 (23:17 +0300)
committerkhizmax <libcds.dev@gmail.com>
Mon, 14 Mar 2016 20:17:10 +0000 (23:17 +0300)
cds/intrusive/impl/feldman_hashset.h

index 936b5a22fe8b493a8421b97af3e6f4422a85504d..8b26b28f26bea1b9aa2c2d0d41cb30992c945946 100644 (file)
@@ -1155,9 +1155,11 @@ namespace cds { namespace intrusive {
         {
             if ( iter.m_set != this )
                 return false;
-            if ( iter.m_pNode == head() && iter.m_idx >= head_size())
-                return false;
-            if ( iter.m_idx >= array_node_size())
+            if ( iter.m_pNode == head()) {
+                if ( iter.m_idx >= head_size())
+                    return false;
+            }
+            else if ( iter.m_idx >= array_node_size())
                 return false;
 
             for (;;) {