[FileCheck] Avoid repeated hash lookups (NFC) (#131553)

This commit is contained in:
Kazu Hirata 2025-03-17 07:41:51 -07:00 committed by GitHub
parent 8bc0f879a0
commit b8317df8d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1010,8 +1010,10 @@ bool Pattern::parsePattern(StringRef PatternStr, StringRef Prefix,
// Handle substitution of string variables that were defined earlier on
// the same line by emitting a backreference. Expressions do not
// support substituting a numeric variable defined on the same line.
if (!IsNumBlock && VariableDefs.find(SubstStr) != VariableDefs.end()) {
unsigned CaptureParenGroup = VariableDefs[SubstStr];
decltype(VariableDefs)::iterator It;
if (!IsNumBlock &&
(It = VariableDefs.find(SubstStr)) != VariableDefs.end()) {
unsigned CaptureParenGroup = It->second;
if (CaptureParenGroup < 1 || CaptureParenGroup > 9) {
SM.PrintMessage(SMLoc::getFromPointer(SubstStr.data()),
SourceMgr::DK_Error,