Skip to content

Commit

Permalink
Set m_seed in build_from_hashes instead of build_from_keys
Browse files Browse the repository at this point in the history
Not setting the seed in build_from_hashes prevents users of the crate from
using it, as they otherwise cannot set the seed
  • Loading branch information
progval committed Apr 30, 2024
1 parent 28aedcb commit 246e552
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/builders/internal_memory_builder_single_phf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ struct internal_memory_builder_single_phf {
}
throw seed_runtime_error();
}
m_seed = config.seed;
return build_from_hashes(hash_generator<RandomAccessIterator>(keys, m_seed), num_keys,
config);
}
Expand All @@ -54,6 +53,7 @@ struct internal_memory_builder_single_phf {
? (std::ceil((config.c * num_keys) / std::log2(num_keys)))
: config.num_buckets;

m_seed = config.seed;
m_num_keys = num_keys;
m_table_size = table_size;
m_num_buckets = num_buckets;
Expand Down

0 comments on commit 246e552

Please sign in to comment.