mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Fix clang-tidy bugprone-inc-dec-in-conditions
report in Spicy plugins glue compiler
This commit is contained in:
parent
37b095f39b
commit
24071118eb
1 changed files with 2 additions and 6 deletions
|
@ -38,12 +38,8 @@ static std::string::size_type looking_at(const std::string& chunk, std::string::
|
||||||
const std::string_view& token) {
|
const std::string_view& token) {
|
||||||
eat_spaces(chunk, &i);
|
eat_spaces(chunk, &i);
|
||||||
|
|
||||||
for ( char j : token ) {
|
bool token_at_position = i < chunk.size() && token == std::string_view(chunk).substr(i, token.size());
|
||||||
if ( i >= chunk.size() || chunk[i++] != j )
|
return token_at_position ? i + token.size() : 0;
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void eat_token(const std::string& chunk, std::string::size_type* i, const std::string_view& token) {
|
static void eat_token(const std::string& chunk, std::string::size_type* i, const std::string_view& token) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue