Skip to content

Commit 6f1bd27

Browse files
committed
Move var into conditional block where used
1 parent 23a0e26 commit 6f1bd27

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/utils/regex.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,6 @@ RegexResult Regex::searchOneMatch(const std::string& s, std::vector<SMatchCaptur
242242
}
243243

244244
RegexResult Regex::searchGlobal(const std::string& s, std::vector<SMatchCapture>& captures, unsigned long match_limit) const {
245-
const char *subject = s.c_str();
246-
247245
bool prev_match_zero_length = false;
248246
#ifdef WITH_PCRE2
249247
Pcre2MatchContextPtr match_context;
@@ -266,6 +264,7 @@ RegexResult Regex::searchGlobal(const std::string& s, std::vector<SMatchCapture>
266264
PCRE2_SIZE *ovector = pcre2_get_ovector_pointer(match_data);
267265

268266
#else
267+
const char *subject = s.c_str();
269268
pcre_extra local_pce;
270269
pcre_extra *pce = m_pce;
271270

0 commit comments

Comments
 (0)