Skip to content

Commit 7b5e115

Browse files
committed
dropped compile-time-n bulk ops
1 parent 511740f commit 7b5e115

File tree

1 file changed

+2
-80
lines changed

1 file changed

+2
-80
lines changed

include/boost/bloom/detail/core.hpp

Lines changed: 2 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ class filter_core:empty_value<Allocator,0>
392392
BOOST_FORCEINLINE void bulk_insert(HashStream h,std::size_t n)
393393
{
394394
while(n>=2*bulk_insert_size){
395-
bulk_insert_impl<bulk_insert_size>(h);
395+
bulk_insert_impl(h,bulk_insert_size);
396396
n-=bulk_insert_size;
397397
}
398398
if(n){
@@ -404,7 +404,7 @@ class filter_core:empty_value<Allocator,0>
404404
BOOST_FORCEINLINE void bulk_may_contain(HashStream h,std::size_t n,F f)const
405405
{
406406
while(n>=2*bulk_may_contain_size){
407-
bulk_may_contain_impl<bulk_may_contain_size>(h,f);
407+
bulk_may_contain_impl(h,bulk_may_contain_size,f);
408408
n-=bulk_may_contain_size;
409409
}
410410
if(n){
@@ -729,34 +729,6 @@ class filter_core:empty_value<Allocator,0>
729729
return p;
730730
}
731731

732-
template<std::size_t N,typename HashStream>
733-
BOOST_FORCEINLINE void bulk_insert_impl(HashStream&& h)
734-
{
735-
std::uint64_t hashes[N];
736-
unsigned char* positions[N];
737-
738-
for(auto i=N;i--;){
739-
auto& hash=hashes[i]=h();
740-
auto& p=positions[i];
741-
hs.prepare_hash(hash);
742-
p=next_element(hash);
743-
}
744-
if(BOOST_UNLIKELY(ar.data==nullptr))return;
745-
for(auto j=k-1;j--;){
746-
for(auto i=N;i--;){
747-
auto& hash=hashes[i];
748-
auto& p=positions[i];
749-
set(p,hash);
750-
p=next_element(hash);
751-
}
752-
}
753-
for(auto i=N;i--;){
754-
auto& hash=hashes[i];
755-
auto& p=positions[i];
756-
set(p,hash);
757-
}
758-
}
759-
760732
template<typename HashStream>
761733
BOOST_FORCEINLINE void bulk_insert_impl(HashStream&& h,std::size_t n)
762734
{
@@ -785,56 +757,6 @@ class filter_core:empty_value<Allocator,0>
785757
}
786758
}
787759

788-
template<std::size_t N,typename HashStream,typename F>
789-
BOOST_FORCEINLINE void bulk_may_contain_impl(HashStream&& h,F&& f)const
790-
{
791-
if(k==1){
792-
std::uint64_t hashes[N];
793-
const unsigned char* positions[N];
794-
795-
for(auto i=N;i--;){
796-
auto& hash=hashes[i]=h();
797-
auto& p=positions[i];
798-
hs.prepare_hash(hash);
799-
p=next_element(hash);
800-
}
801-
for(auto i=N;i--;){
802-
auto& hash=hashes[i];
803-
auto& p=positions[i];
804-
f(get(p,hash));
805-
}
806-
}
807-
else{
808-
std::uint64_t hashes[N];
809-
const unsigned char* positions[N];
810-
bool results[N];
811-
812-
for(auto i=N;i--;){
813-
auto& hash=hashes[i]=h();
814-
auto& p=positions[i];
815-
results[i]=true;
816-
hs.prepare_hash(hash);
817-
p=next_element(hash);
818-
}
819-
for(auto j=k-1;j--;){
820-
for(auto i=N;i--;){
821-
auto& hash=hashes[i];
822-
auto& p=positions[i];
823-
auto& res=results[i];
824-
res&=get(p,hash);
825-
p=next_element(hash);
826-
}
827-
}
828-
for(auto i=N;i--;){
829-
auto& hash=hashes[i];
830-
auto& p=positions[i];
831-
auto& res=results[i];
832-
res&=get(p,hash);
833-
f(res);
834-
}
835-
}
836-
}
837-
838760
template<typename HashStream,typename F>
839761
BOOST_FORCEINLINE void bulk_may_contain_impl(
840762
HashStream&& h,std::size_t n,F&& f)const

0 commit comments

Comments
 (0)