mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 08:38:20 +00:00
util: add a tokenize_string() overload which returns string_views
Additionally, it uses a single "char" as delimiter, which is also faster. This patch speeds up Zeek startup by 10%.
This commit is contained in:
parent
763afe6f5f
commit
26da10ca05
2 changed files with 24 additions and 6 deletions
|
@ -150,6 +150,8 @@ std::vector<std::string>* tokenize_string(std::string_view input,
|
|||
std::string_view delim,
|
||||
std::vector<std::string>* rval = 0, int limit = 0);
|
||||
|
||||
std::vector<std::string_view> tokenize_string(const std::string_view input, const char delim) noexcept;
|
||||
|
||||
extern char* copy_string(const char* s);
|
||||
extern int streq(const char* s1, const char* s2);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue