From 1657d2dedf39436ab23b3eeb1e13093af4e2d3d8 Mon Sep 17 00:00:00 2001 From: khizmax Date: Wed, 10 Feb 2016 23:45:25 +0300 Subject: [PATCH] Removed redundant checking --- cds/intrusive/lazy_list_rcu.h | 5 +---- cds/intrusive/michael_list_rcu.h | 4 ---- 2 files changed, 1 insertion(+), 8 deletions(-) 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 ); -- 2.34.1