@@ -178,17 +178,19 @@ RegexResult Matcher<Parser>::match(Vector<RegexStringView> const& views, Optiona
178178 for (auto const & view : views)
179179 const_cast <RegexStringView&>(view).set_unicode (unicode);
180180
181- if (input.regex_options .has_flag_set (AllFlags::Internal_Stateful)) {
182- if (views.size () > 1 && input.start_offset > views.first ().length ()) {
183- dbgln_if (REGEX_DEBUG, " Started with start={}, goff={}, skip={}" , input.start_offset , input.global_offset , lines_to_skip);
184- for (auto const & view : views) {
185- if (input.start_offset < view.length () + 1 )
186- break ;
187- ++lines_to_skip;
188- input.start_offset -= view.length () + 1 ;
189- input.global_offset += view.length () + 1 ;
181+ if constexpr (REGEX_DEBUG) {
182+ if (input.regex_options .has_flag_set (AllFlags::Internal_Stateful)) {
183+ if (views.size () > 1 && input.start_offset > views.first ().length ()) {
184+ dbgln (" Started with start={}, goff={}, skip={}" , input.start_offset , input.global_offset , lines_to_skip);
185+ for (auto const & view : views) {
186+ if (input.start_offset < view.length () + 1 )
187+ break ;
188+ ++lines_to_skip;
189+ input.start_offset -= view.length () + 1 ;
190+ input.global_offset += view.length () + 1 ;
191+ }
192+ dbgln (" Ended with start={}, goff={}, skip={}" , input.start_offset , input.global_offset , lines_to_skip);
190193 }
191- dbgln_if (REGEX_DEBUG, " Ended with start={}, goff={}, skip={}" , input.start_offset , input.global_offset , lines_to_skip);
192194 }
193195 }
194196
0 commit comments