From a167941852f5547a23eb4a0b26460fe7bc0dbbbc Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sun, 13 Jun 2021 22:59:36 +0200 Subject: [PATCH] LibRegex: Use a plain pointer for OpCode::m_state --- Userland/Libraries/LibRegex/RegexByteCode.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibRegex/RegexByteCode.h b/Userland/Libraries/LibRegex/RegexByteCode.h index 7d78c1303c..ca7cbf10fe 100644 --- a/Userland/Libraries/LibRegex/RegexByteCode.h +++ b/Userland/Libraries/LibRegex/RegexByteCode.h @@ -501,12 +501,12 @@ public: ALWAYS_INLINE void set_bytecode(ByteCode& bytecode) { m_bytecode = &bytecode; } - ALWAYS_INLINE void reset_state() { m_state.clear(); } + ALWAYS_INLINE void reset_state() { m_state = nullptr; } ALWAYS_INLINE const MatchState& state() const { - VERIFY(m_state.has_value()); - return *m_state.value(); + VERIFY(m_state); + return *m_state; } const String to_string() const @@ -520,7 +520,7 @@ public: protected: ByteCode* m_bytecode { nullptr }; - Optional m_state; + MatchState* m_state { nullptr }; }; class OpCode_Exit final : public OpCode {