diff options
author | Linus Groh <mail@linusgroh.de> | 2021-04-23 20:50:27 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-04-23 20:52:12 +0200 |
commit | a4c1860bfcf48c1fb7c555bcc95f1a591b115cc2 (patch) | |
tree | 7d2e7387ff1208848604ce5a2be7ddd2ad0bed98 | |
parent | 0053816e9dd372664e8c58fde4855ba9f5e2b300 (diff) | |
download | serenity-a4c1860bfcf48c1fb7c555bcc95f1a591b115cc2.zip |
LibRegex: Put to dbgln()s behind REGEX_DEBUG
-rw-r--r-- | Userland/Libraries/LibRegex/RegexMatcher.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Userland/Libraries/LibRegex/RegexMatcher.cpp b/Userland/Libraries/LibRegex/RegexMatcher.cpp index 566ac74fd5..568267bf16 100644 --- a/Userland/Libraries/LibRegex/RegexMatcher.cpp +++ b/Userland/Libraries/LibRegex/RegexMatcher.cpp @@ -86,7 +86,7 @@ RegexResult Matcher<Parser>::match(const Vector<RegexStringView> views, Optional if (input.regex_options.has_flag_set(AllFlags::Internal_Stateful)) { if (views.size() > 1 && input.start_offset > views.first().length()) { - dbgln("Started with start={}, goff={}, skip={}", input.start_offset, input.global_offset, lines_to_skip); + dbgln_if(REGEX_DEBUG, "Started with start={}, goff={}, skip={}", input.start_offset, input.global_offset, lines_to_skip); for (auto& view : views) { if (input.start_offset < view.length() + 1) break; @@ -94,7 +94,7 @@ RegexResult Matcher<Parser>::match(const Vector<RegexStringView> views, Optional input.start_offset -= view.length() + 1; input.global_offset += view.length() + 1; } - dbgln("Ended with start={}, goff={}, skip={}", input.start_offset, input.global_offset, lines_to_skip); + dbgln_if(REGEX_DEBUG, "Ended with start={}, goff={}, skip={}", input.start_offset, input.global_offset, lines_to_skip); } } @@ -213,10 +213,8 @@ RegexResult Matcher<Parser>::match(const Vector<RegexStringView> views, Optional continue; } - if constexpr (REGEX_DEBUG) { - dbgln("state.string_position={}, view_index={}", state.string_position, view_index); - dbgln("[match] Found a match (length={}): '{}'", state.string_position - view_index, input.view.substring_view(view_index, state.string_position - view_index)); - } + dbgln_if(REGEX_DEBUG, "state.string_position={}, view_index={}", state.string_position, view_index); + dbgln_if(REGEX_DEBUG, "[match] Found a match (length={}): '{}'", state.string_position - view_index, input.view.substring_view(view_index, state.string_position - view_index)); ++match_count; |