Avoid static reference to temporary

These caused issues when used in a wasm project.
This commit is contained in:
Frank Osterfeld
2024-04-11 23:16:44 +02:00
committed by Jesse Beder
parent 76dc671573
commit 1d8ca1f35e

View File

@@ -173,11 +173,11 @@ bool IsValidPlainScalar(const std::string& str, FlowType::value flowType,
}
// then check until something is disallowed
static const RegEx& disallowed_flow =
static const RegEx disallowed_flow =
Exp::EndScalarInFlow() | (Exp::BlankOrBreak() + Exp::Comment()) |
Exp::NotPrintable() | Exp::Utf8_ByteOrderMark() | Exp::Break() |
Exp::Tab() | Exp::Ampersand();
static const RegEx& disallowed_block =
static const RegEx disallowed_block =
Exp::EndScalar() | (Exp::BlankOrBreak() + Exp::Comment()) |
Exp::NotPrintable() | Exp::Utf8_ByteOrderMark() | Exp::Break() |
Exp::Tab() | Exp::Ampersand();