From 40c2535ad52ebe5c7e9cd16c4892b4f8182843f3 Mon Sep 17 00:00:00 2001 From: khizmax Date: Tue, 9 Feb 2016 23:30:24 +0300 Subject: [PATCH] Removed redundant checking --- cds/intrusive/lazy_list_nogc.h | 5 ++--- cds/intrusive/michael_list_nogc.h | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cds/intrusive/lazy_list_nogc.h b/cds/intrusive/lazy_list_nogc.h index e43bd3f5..c2434d22 100644 --- a/cds/intrusive/lazy_list_nogc.h +++ b/cds/intrusive/lazy_list_nogc.h @@ -201,6 +201,7 @@ namespace cds { namespace intrusive { void link_node( node_type * pNode, node_type * pPred, node_type * pCur ) { + link_checker::is_empty( pNode ); assert( pPred->m_pNext.load(memory_model::memory_order_relaxed) == pCur ); pNode->m_pNext.store( pCur, memory_model::memory_order_release ); @@ -558,6 +559,7 @@ namespace cds { namespace intrusive { while ( pHead != &m_Tail ) { node_type * p = pHead->m_pNext.load(memory_model::memory_order_relaxed); dispose_node( pHead, disp ); + --m_ItemCounter; pHead = p; } } @@ -612,7 +614,6 @@ namespace cds { namespace intrusive { bool insert_at( node_type * pHead, value_type& val ) { - link_checker::is_empty( node_traits::to_node_ptr( val ) ); position pos; key_comparator pred; @@ -665,8 +666,6 @@ namespace cds { namespace intrusive { if ( !bAllowInsert ) return std::make_pair( end(), false ); - link_checker::is_empty( node_traits::to_node_ptr( val ) ); - link_node( node_traits::to_node_ptr( val ), pos.pPred, pos.pCur ); func( true, val, val ); ++m_ItemCounter; diff --git a/cds/intrusive/michael_list_nogc.h b/cds/intrusive/michael_list_nogc.h index e8ba4dd0..9a539b51 100644 --- a/cds/intrusive/michael_list_nogc.h +++ b/cds/intrusive/michael_list_nogc.h @@ -530,7 +530,6 @@ namespace cds { namespace intrusive { bool insert_at( atomic_node_ptr& refHead, value_type& val ) { - link_checker::is_empty( node_traits::to_node_ptr( val ) ); position pos; while ( true ) { @@ -567,8 +566,6 @@ namespace cds { namespace intrusive { if ( !bAllowInsert ) 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