diff --git a/src/script_opt/ProfileFunc.h b/src/script_opt/ProfileFunc.h index 6d02f3660e..1016145759 100644 --- a/src/script_opt/ProfileFunc.h +++ b/src/script_opt/ProfileFunc.h @@ -31,6 +31,8 @@ #pragma once +#include + #include "zeek/Expr.h" #include "zeek/Stmt.h" #include "zeek/Traverse.h" @@ -49,11 +51,8 @@ using p_hash_type = unsigned long long; inline p_hash_type p_hash(int val) { return std::hash{}(val); } -inline p_hash_type p_hash(std::string val) - { return std::hash{}(val); } - -inline p_hash_type p_hash(const char* val) - { return p_hash(std::string(val)); } +inline p_hash_type p_hash(std::string_view val) + { return std::hash{}(val); } extern p_hash_type p_hash(const Obj* o); inline p_hash_type p_hash(const IntrusivePtr& o)