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;
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;
template <typename T, typename Tree>
bool operator()( T& dest, Tree& container ) const
{
- typename Tree::guarded_ptr gp;
- bool bRet = container.extract_max( gp );
- if ( bRet )
+ typename Tree::guarded_ptr gp( container.extract_max());
+ if ( gp )
dest = *gp;
- return bRet;
+ return !gp.empty();
}
};
template <typename T, typename Tree>
bool operator()( T& dest, Tree& container ) const
{
- typename Tree::guarded_ptr gp;
- bool bRet = container.extract_min( gp );
- if ( bRet )
+ typename Tree::guarded_ptr gp( container.extract_min());
+ if ( gp )
dest = *gp;
- return bRet;
+ return !gp.empty();
}
};
template <typename T, typename Set>
bool operator()( T& dest, Set& container ) const
{
- typename Set::guarded_ptr gp;
- bool bRet = container.extract_max( gp );
- if ( bRet )
+ typename Set::guarded_ptr gp( container.extract_max());
+ if ( gp )
dest = *gp;
- return bRet;
+ return !gp.empty();
}
};
template <typename T, typename Set>
bool operator()( T& dest, Set& container ) const
{
- typename Set::guarded_ptr gp;
- bool bRet = container.extract_min( gp );
- if ( bRet )
+ typename Set::guarded_ptr gp( container.extract_min());
+ if ( gp )
dest = *gp;
- return bRet;
+ return !gp.empty();
}
};
for ( size_t k = 0; k < c_nInsThreadCount; ++k ) {
for ( size_t i = 0; i < arrData.size(); ++i ) {
if ( arrData[i] & 1 ) {
- if ( rSet.extract_with( gp, arrData[i], key_less() ))
+ gp = rSet.extract_with( arrData[i], key_less());
+ if ( gp )
++m_nExtractSuccess;
else
++m_nExtractFailed;
for ( size_t k = 0; k < c_nInsThreadCount; ++k ) {
for ( size_t i = arrData.size() - 1; i > 0; --i ) {
if ( arrData[i] & 1 ) {
- if ( rSet.extract_with( gp, arrData[i], key_less() ))
+ gp = rSet.extract_with( arrData[i], key_less());
+ if ( gp )
++m_nExtractSuccess;
else
++m_nExtractFailed;
if ( m_nThreadNo & 1 ) {
for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
for ( size_t nItem = 0; nItem < c_nMapSize; ++nItem ) {
- if ( rSet.extract( gp, arrString[nItem % nArrSize] ) )
+ gp = rSet.extract( arrString[nItem % nArrSize]);
+ if ( gp )
++m_nDeleteSuccess;
else
++m_nDeleteFailed;
else {
for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
for ( size_t nItem = c_nMapSize; nItem > 0; --nItem ) {
- if ( rSet.extract( gp, arrString[nItem % nArrSize] ) )
+ gp = rSet.extract( arrString[nItem % nArrSize]);
+ if ( gp )
++m_nDeleteSuccess;
else
++m_nDeleteFailed;