Skip to content

Commit eec6dfd

Browse files
committed
define hash function for string_view
1 parent b8936d5 commit eec6dfd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cpp/src/gandiva/in_holder.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <string>
2121
#include <unordered_set>
2222

23+
#include "arrow/util/hashing.h"
2324
#include "gandiva/arrow.h"
2425
#include "gandiva/gandiva_aliases.h"
2526

@@ -57,7 +58,14 @@ class InHolder<std::string> {
5758
}
5859

5960
private:
60-
std::unordered_set<arrow::util::string_view> values_lookup_;
61+
struct string_view_hash {
62+
public:
63+
std::size_t operator()(arrow::util::string_view v) const {
64+
return arrow::internal::ComputeStringHash<0>(v.data(), v.length());
65+
}
66+
};
67+
68+
std::unordered_set<arrow::util::string_view, string_view_hash> values_lookup_;
6169
const std::unordered_set<std::string> values_;
6270
};
6371

0 commit comments

Comments
 (0)