mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 05:58:20 +00:00
Use std::string/string_view versions of starts_with/ends_with where appropriate
The util:: versions of these methods remain as a thin wrapper around them so they can be used with const char* arguments. Otherwise callers have to manually make string_view objects from the input. s Please enter the commit message for your changes. Lines starting
This commit is contained in:
parent
6218643347
commit
a1d121e5aa
17 changed files with 30 additions and 55 deletions
|
@ -241,7 +241,7 @@ bool Ascii::GetLine(string& str) {
|
|||
if ( str[0] != '#' )
|
||||
return true;
|
||||
|
||||
if ( (str.length() > 8) && (str.compare(0, 7, "#fields") == 0) && (str[7] == separator[0]) ) {
|
||||
if ( (str.length() > 8) && str.starts_with("#fields") && (str[7] == separator[0]) ) {
|
||||
str = str.substr(8);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue