Skip to content

Commit

Permalink
Merge pull request #65 from tocic/fix/reduntant_if_condition
Browse files Browse the repository at this point in the history
Simplify is_match's early exit condition
  • Loading branch information
cschreib authored Feb 2, 2023
2 parents 4ee70a1 + 59b561f commit 8dc9f62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/snitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ bool is_match(std::string_view string, std::string_view regex) noexcept {
// An empty regex matches any string; early exit.
// An empty string matches an empty regex (exit here) or any regex containing
// only wildcards (exit later).
if ((string.empty() && regex.empty()) || regex.empty()) {
if (regex.empty()) {
return true;
}

Expand Down

0 comments on commit 8dc9f62

Please sign in to comment.