mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-31 03:47:16 +02:00
tried yest another variation for for_all_elements_while
This commit is contained in:
committed by
Christian Mazakas
parent
d683b3ac3e
commit
3d34571654
@ -1634,12 +1634,12 @@ public:
|
|||||||
static auto for_all_elements_while(const arrays_type& arrays_,F f)
|
static auto for_all_elements_while(const arrays_type& arrays_,F f)
|
||||||
->decltype(f(nullptr,0,nullptr),void())
|
->decltype(f(nullptr,0,nullptr),void())
|
||||||
{
|
{
|
||||||
#if 0
|
#if 1
|
||||||
auto p=arrays_.elements;
|
auto p=arrays_.elements;
|
||||||
if(!p){return;}
|
if(!p){return;}
|
||||||
for(auto pg=arrays_.groups,last=pg+arrays_.groups_size_mask+1;
|
for(auto pg=arrays_.groups,last=pg+arrays_.groups_size_mask+1;
|
||||||
pg!=last;++pg,p+=N){
|
pg!=last;++pg,p+=N){
|
||||||
auto mask=pg->match_really_occupied();
|
auto mask=pg->match_occupied()&~(int(pg==last-1)<<(N-1));
|
||||||
while(mask){
|
while(mask){
|
||||||
auto n=unchecked_countr_zero(mask);
|
auto n=unchecked_countr_zero(mask);
|
||||||
if(!f(pg,n,p+n))return;
|
if(!f(pg,n,p+n))return;
|
||||||
|
Reference in New Issue
Block a user