Skip to content

Commit

Permalink
define hash function for string_view
Browse files Browse the repository at this point in the history
  • Loading branch information
pprudhvi committed Oct 27, 2020
1 parent b8936d5 commit eec6dfd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cpp/src/gandiva/in_holder.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <string>
#include <unordered_set>

#include "arrow/util/hashing.h"
#include "gandiva/arrow.h"
#include "gandiva/gandiva_aliases.h"

Expand Down Expand Up @@ -57,7 +58,14 @@ class InHolder<std::string> {
}

private:
std::unordered_set<arrow::util::string_view> values_lookup_;
struct string_view_hash {
public:
std::size_t operator()(arrow::util::string_view v) const {
return arrow::internal::ComputeStringHash<0>(v.data(), v.length());
}
};

std::unordered_set<arrow::util::string_view, string_view_hash> values_lookup_;
const std::unordered_set<std::string> values_;
};

Expand Down

0 comments on commit eec6dfd

Please sign in to comment.