From: khizmax Date: Wed, 10 Feb 2016 20:45:25 +0000 (+0300) Subject: Removed redundant checking X-Git-Tag: v2.2.0~398 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1657d2dedf39436ab23b3eeb1e13093af4e2d3d8;p=libcds.git Removed redundant checking --- diff --git a/cds/intrusive/lazy_list_rcu.h b/cds/intrusive/lazy_list_rcu.h index a9622c23..1742f21d 100644 --- a/cds/intrusive/lazy_list_rcu.h +++ b/cds/intrusive/lazy_list_rcu.h @@ -228,6 +228,7 @@ namespace cds { namespace intrusive { static void link_node( node_type * pNode, node_type * pPred, node_type * pCur ) { assert( pPred->m_pNext.load(memory_model::memory_order_relaxed).ptr() == pCur ); + link_checker::is_empty( pNode ); pNode->m_pNext.store( marked_node_ptr(pCur), memory_model::memory_order_relaxed ); pPred->m_pNext.store( marked_node_ptr(pNode), memory_model::memory_order_release ); @@ -906,7 +907,6 @@ namespace cds { namespace intrusive { template bool insert_at( node_type * pHead, value_type& val, Func f ) { - link_checker::is_empty( node_traits::to_node_ptr( val )); position pos; key_comparator cmp; @@ -1174,7 +1174,6 @@ namespace cds { namespace intrusive { // RCU lock should be locked assert( gc::is_locked()); - link_checker::is_empty( node_traits::to_node_ptr( val )); position pos; key_comparator cmp; @@ -1221,8 +1220,6 @@ namespace cds { namespace intrusive { if ( !bAllowInsert ) return std::make_pair( end(), false ); - link_checker::is_empty( node_traits::to_node_ptr( val )); - func( true, val, val ); link_node( node_traits::to_node_ptr( val ), pos.pPred, pos.pCur ); ++m_ItemCounter; diff --git a/cds/intrusive/michael_list_rcu.h b/cds/intrusive/michael_list_rcu.h index ff9efaf1..cea4f18e 100644 --- a/cds/intrusive/michael_list_rcu.h +++ b/cds/intrusive/michael_list_rcu.h @@ -916,7 +916,6 @@ namespace cds { namespace intrusive { template bool insert_at( atomic_node_ptr& refHead, value_type& val, Func f ) { - link_checker::is_empty( node_traits::to_node_ptr( val ) ); position pos( refHead ); { @@ -1164,7 +1163,6 @@ namespace cds { namespace intrusive { { // RCU lock should be locked!!! assert( gc::is_locked() ); - link_checker::is_empty( node_traits::to_node_ptr( val ) ); while ( true ) { if ( search( pos.refHead, val, pos, key_comparator() ) ) @@ -1197,8 +1195,6 @@ namespace cds { namespace intrusive { if ( !bInsert ) return std::make_pair( end(), false ); - link_checker::is_empty( node_traits::to_node_ptr( val ) ); - if ( link_node( node_traits::to_node_ptr( val ), pos ) ) { ++m_ItemCounter; func( true, val , val );