mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-29 19:07:15 +02:00
replaced get_cumulative_stats() with direct access to cstats
This commit is contained in:
@ -514,8 +514,7 @@ public:
|
||||
x.arrays=ah.release();
|
||||
x.size_ctrl.ml=x.initial_max_load();
|
||||
x.size_ctrl.size=0;
|
||||
BOOST_UNORDERED_SWAP_STATS(
|
||||
this->get_cumulative_stats(),x.get_cumulative_stats());
|
||||
BOOST_UNORDERED_SWAP_STATS(this->cstats,x.cstats);
|
||||
}
|
||||
|
||||
concurrent_table(compatible_nonconcurrent_table&& x):
|
||||
@ -1216,8 +1215,7 @@ private:
|
||||
if(BOOST_LIKELY(bool(this->pred()(x,this->key_from(p[n]))))){
|
||||
f(pg,n,p+n);
|
||||
BOOST_UNORDERED_ADD_STATS(
|
||||
this->get_cumulative_stats().successful_lookup,
|
||||
(pb.length(),num_cmps));
|
||||
this->cstats.successful_lookup,(pb.length(),num_cmps));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -1226,14 +1224,13 @@ private:
|
||||
}
|
||||
if(BOOST_LIKELY(pg->is_not_overflowed(hash))){
|
||||
BOOST_UNORDERED_ADD_STATS(
|
||||
this->get_cumulative_stats().unsuccessful_lookup,
|
||||
(pb.length(),num_cmps));
|
||||
this->cstats.unsuccessful_lookup,(pb.length(),num_cmps));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
while(BOOST_LIKELY(pb.next(this->arrays.groups_size_mask)));
|
||||
BOOST_UNORDERED_ADD_STATS(
|
||||
this->get_cumulative_stats().unsuccessful_lookup,(pb.length(),num_cmps));
|
||||
this->cstats.unsuccessful_lookup,(pb.length(),num_cmps));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1514,8 +1511,7 @@ private:
|
||||
this->construct_element(p,std::forward<Args>(args)...);
|
||||
rslot.commit();
|
||||
rsize.commit();
|
||||
BOOST_UNORDERED_ADD_STATS(
|
||||
this->get_cumulative_stats().insertion,(pb.length()));
|
||||
BOOST_UNORDERED_ADD_STATS(this->cstats.insertion,(pb.length()));
|
||||
return 1;
|
||||
}
|
||||
pg->mark_overflow(hash);
|
||||
|
@ -1719,7 +1719,7 @@ public:
|
||||
auto n=unchecked_countr_zero(mask);
|
||||
if(BOOST_LIKELY(bool(pred()(x,key_from(p[n]))))){
|
||||
BOOST_UNORDERED_ADD_STATS(
|
||||
get_cumulative_stats().successful_lookup,(pb.length(),num_cmps));
|
||||
cstats.successful_lookup,(pb.length(),num_cmps));
|
||||
return {pg,n,p+n};
|
||||
}
|
||||
mask&=mask-1;
|
||||
@ -1727,13 +1727,13 @@ public:
|
||||
}
|
||||
if(BOOST_LIKELY(pg->is_not_overflowed(hash))){
|
||||
BOOST_UNORDERED_ADD_STATS(
|
||||
get_cumulative_stats().unsuccessful_lookup,(pb.length(),num_cmps));
|
||||
cstats.unsuccessful_lookup,(pb.length(),num_cmps));
|
||||
return {};
|
||||
}
|
||||
}
|
||||
while(BOOST_LIKELY(pb.next(arrays.groups_size_mask)));
|
||||
BOOST_UNORDERED_ADD_STATS(
|
||||
get_cumulative_stats().unsuccessful_lookup,(pb.length(),num_cmps));
|
||||
cstats.unsuccessful_lookup,(pb.length(),num_cmps));
|
||||
return {};
|
||||
}
|
||||
|
||||
@ -1842,11 +1842,6 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
cumulative_stats& get_cumulative_stats()const noexcept
|
||||
{
|
||||
return cstats;
|
||||
}
|
||||
|
||||
void reset_stats()
|
||||
{
|
||||
cstats.insertion.reset();
|
||||
@ -2356,8 +2351,7 @@ private:
|
||||
auto p=arrays_.elements()+pos*N+n;
|
||||
construct_element(p,std::forward<Args>(args)...);
|
||||
pg->set(n,hash);
|
||||
BOOST_UNORDERED_ADD_STATS(
|
||||
get_cumulative_stats().insertion,(pb.length()));
|
||||
BOOST_UNORDERED_ADD_STATS(cstats.insertion,(pb.length()));
|
||||
return {pg,n,p};
|
||||
}
|
||||
else pg->mark_overflow(hash);
|
||||
|
@ -593,8 +593,7 @@ private:
|
||||
x.arrays=ah.release();
|
||||
x.size_ctrl.ml=x.initial_max_load();
|
||||
x.size_ctrl.size=0;
|
||||
BOOST_UNORDERED_SWAP_STATS(
|
||||
this->get_cumulative_stats(),x.get_cumulative_stats());
|
||||
BOOST_UNORDERED_SWAP_STATS(this->cstats,x.cstats);
|
||||
}
|
||||
|
||||
template<typename ExclusiveLockGuard>
|
||||
|
Reference in New Issue
Block a user