Val: Switch TablePatternMatcher to std::string_view

...and add TableVal::LookupPattern(std::string_view sv).
This commit is contained in:
Arne Welzel 2025-06-26 17:10:50 +02:00
parent dce51b99e5
commit dad5ccd622
2 changed files with 18 additions and 9 deletions

View file

@ -4,6 +4,8 @@
#include <sys/types.h> // for u_char
#include <array>
#include <string>
#include <string_view>
#include <unordered_map>
#include <vector>
@ -898,6 +900,11 @@ public:
// Causes an internal error if called for any other kind of table.
VectorValPtr LookupPattern(const StringValPtr& s);
// For a table[pattern], return a vector of all yields matching
// the given string.
// Causes an internal error if called for any other kind of table.
VectorValPtr LookupPattern(std::string_view sv);
// For a table[pattern] or set[pattern], returns True if any of the
// patterns in the index matches the given string, else False.
// Causes an internal error if called for any other kind of table.