fix priority queue unit tests
[libcds.git] / tests / unit / pqueue / skiplist_pqueue.h
index 68a816e9c300c7d2a61d628a4d89fd4439f95efe..92ef9df04d0e92acf49c074d53caf14e087c4fed 100644 (file)
@@ -34,11 +34,10 @@ namespace pqueue {
         template <typename T, typename Set>
         bool operator()( T& dest, Set& container ) const
         {
-            typename Set::exempt_ptr ep;
-            bool bRet = container.extract_max( ep );
-            if ( bRet )
+            typename Set::exempt_ptr ep( container.extract_max());
+            if ( ep )
                 dest = *ep;
-            return bRet;
+            return !ep.empty();
         }
     };
 
@@ -62,11 +61,10 @@ namespace pqueue {
         template <typename T, typename Set>
         bool operator()( T& dest, Set& container ) const
         {
-            typename Set::exempt_ptr ep;
-            bool bRet = container.extract_min( ep );
-            if ( bRet )
+            typename Set::exempt_ptr ep( container.extract_min());
+            if ( ep )
                 dest = *ep;
-            return bRet;
+            return !ep.empty();
         }
     };