From b57dc7c512d25d71206489df3cb4baf054051c8f Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 31 Jul 2021 08:55:52 +1000 Subject: [PATCH] Code style tweak for Regex implementation TestVM --- src/regex_impl.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/regex_impl.cc b/src/regex_impl.cc index c5d755ac..b2b485fa 100644 --- a/src/regex_impl.cc +++ b/src/regex_impl.cc @@ -1241,17 +1241,14 @@ namespace template struct TestVM : CompiledRegex, ThreadedRegexVM { - using VMType = ThreadedRegexVM; - - TestVM(StringView re, bool dump = false) - : CompiledRegex{compile_regex(re, mode & RegexMode::Forward ? - RegexCompileFlags::None : RegexCompileFlags::Backward)}, - VMType{(const CompiledRegex&)*this} - { if (dump) puts(dump_regex(*this).c_str()); } + TestVM(StringView re) + : CompiledRegex{compile_regex(re, mode & RegexMode::Forward ? RegexCompileFlags::None : RegexCompileFlags::Backward)}, + TestVM::ThreadedRegexVM{static_cast(*this)} + {} bool exec(StringView re, RegexExecFlags flags = RegexExecFlags::None) { - return VMType::exec(re.begin(), re.end(), re.begin(), re.end(), flags); + return TestVM::ThreadedRegexVM::exec(re.begin(), re.end(), re.begin(), re.end(), flags); } }; }