Removing unused vars
[libcds.git] / tests / unit / map2 / map_delodd.cpp
index a63abd3..f1ecb3f 100644 (file)
@@ -101,8 +101,12 @@ namespace std {
     };
 } // namespace std
 
-/*
 namespace boost {
+    inline size_t hash_value( map2::key_thread const& k )
+    {
+        return std::hash<size_t>()( k.nKey );
+    }
+       
     template <>
     struct hash<map2::key_thread>
     {
@@ -119,12 +123,11 @@ namespace boost {
         }
     };
 } // namespace boost
-*/
 
 namespace map2 {
 
     template <typename Map>
-    static inline void check_before_clear( Map& s )
+    static inline void check_before_clear( Map& /*s*/ )
     {}
 
     template <typename GC, typename Key, typename T, typename Traits>
@@ -158,7 +161,7 @@ namespace map2 {
             struct ensure_func
             {
                 template <typename Q>
-                void operator()( bool bNew, Q const& )
+                void operator()( bool /*bNew*/, Q const& )
                 {}
             };
         public:
@@ -358,10 +361,12 @@ namespace map2 {
                     for ( size_t k = 0; k < c_nInsThreadCount; ++k ) {
                         for ( size_t i = 0; i < arrData.size(); ++i ) {
                             if ( arrData[i] & 1 ) {
-                                if ( rMap.extract_with( gp, arrData[i], key_less() ))
+                                gp = rMap.extract_with( arrData[i], key_less());
+                                if ( gp )
                                     ++m_nDeleteSuccess;
                                 else
                                     ++m_nDeleteFailed;
+                                gp.release();
                             }
                         }
                         if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )
@@ -372,10 +377,12 @@ namespace map2 {
                     for ( size_t k = 0; k < c_nInsThreadCount; ++k ) {
                         for ( size_t i = arrData.size() - 1; i > 0; --i ) {
                             if ( arrData[i] & 1 ) {
-                                if ( rMap.extract_with( gp, arrData[i], key_less() ))
+                                gp = rMap.extract_with( arrData[i], key_less());
+                                if ( gp )
                                     ++m_nDeleteSuccess;
                                 else
                                     ++m_nDeleteFailed;
+                                gp.release();
                             }
                         }
                         if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )
@@ -433,22 +440,21 @@ namespace map2 {
                                 if ( Map::c_bExtractLockExternal ) {
                                     {
                                         typename Map::rcu_lock l;
-                                        if ( rMap.extract_with( xp, arrData[i], key_less() )) {
+                                        xp = rMap.extract_with( arrData[i], key_less() );
+                                        if ( xp )
                                             ++m_nDeleteSuccess;
-                                        }
                                         else
                                             ++m_nDeleteFailed;
                                     }
-                                    xp.release();
                                 }
                                 else {
-                                    if ( rMap.extract_with( xp, arrData[i], key_less() )) {
+                                    xp = rMap.extract_with( arrData[i], key_less() );
+                                    if ( xp )
                                         ++m_nDeleteSuccess;
-                                        xp.release();
-                                    }
                                     else
                                         ++m_nDeleteFailed;
                                 }
+                                xp.release();
                             }
                         }
                         if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )
@@ -462,21 +468,21 @@ namespace map2 {
                                 if ( Map::c_bExtractLockExternal ) {
                                     {
                                         typename Map::rcu_lock l;
-                                        if ( rMap.extract_with( xp, arrData[i], key_less() ))
+                                        xp = rMap.extract_with( arrData[i], key_less() );
+                                        if ( xp )
                                             ++m_nDeleteSuccess;
                                         else
                                             ++m_nDeleteFailed;
                                     }
-                                    xp.release();
                                 }
                                 else {
-                                    if ( rMap.extract_with( xp, arrData[i], key_less() )) {
+                                    xp = rMap.extract_with( arrData[i], key_less() );
+                                    if ( xp )
                                         ++m_nDeleteSuccess;
-                                        xp.release();
-                                    }
                                     else
                                         ++m_nDeleteFailed;
                                 }
+                                xp.release();
                             }
                         }
                         if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )