Skip to content

Commit

Permalink
Use span of const string
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteHamster committed Oct 1, 2024
1 parent 2b6aa91 commit 31a4d7b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/SIMDShockHash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class SIMDShockHash {
* 100 to 2000, with smaller buckets giving slightly larger but faster
* functions.
*/
SIMDShockHash(const span<string> keys, const size_t bucket_size, size_t num_threads = 1) {
SIMDShockHash(span<const string> keys, const size_t bucket_size, size_t num_threads = 1) {
this->bucket_size = bucket_size;
this->keys_count = keys.size();
hash128_t *h = (hash128_t *)malloc(this->keys_count * sizeof(hash128_t));
Expand Down
2 changes: 1 addition & 1 deletion include/ShockHash2.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class ShockHash2 {
ShockHash2() {}


ShockHash2(const span<string> keys, const size_t bucket_size, size_t num_threads = 1) {
ShockHash2(span<const string> keys, const size_t bucket_size, size_t num_threads = 1) {
this->keys_count = keys.size();
hash128_t *h = (hash128_t *)malloc(this->keys_count * sizeof(hash128_t));
if (num_threads == 1) {
Expand Down
4 changes: 2 additions & 2 deletions include/ShockHash2Flat.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ class ShockHash2Flat {
Ribbon ribbon;
size_t layers = 2;
public:
explicit ShockHash2Flat(const std::span<std::string> keys, size_t ignore, size_t ignore2)
explicit ShockHash2Flat(std::span<const std::string> keys, size_t ignore, size_t ignore2)
: ShockHash2Flat(keys) {
(void) ignore;
(void) ignore2;
}

explicit ShockHash2Flat(const std::span<std::string> keys) {
explicit ShockHash2Flat(std::span<const std::string> keys) {
N = keys.size();
nbuckets = N / k;
size_t keysInEndBucket = N - nbuckets * k;
Expand Down

0 comments on commit 31a4d7b

Please sign in to comment.