From ef379815922d1c9cc1afc97063dfb6de5fd42042 Mon Sep 17 00:00:00 2001 From: Brian Ferguson Date: Tue, 4 Sep 2012 09:59:21 -0600 Subject: [PATCH] Performance tweaks --- Library/Measure.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Library/Measure.cpp b/Library/Measure.cpp index 8b8681d2..bd2351ea 100644 --- a/Library/Measure.cpp +++ b/Library/Measure.cpp @@ -246,11 +246,6 @@ const WCHAR* CMeasure::CheckSubstitute(const WCHAR* buffer) int flags = PCRE_UTF8; int offset = 0; - if (m_Substitute[i].empty()) - { - m_Substitute[i] = L"^$"; - } - re = pcre_compile( ConvertToUTF8(m_Substitute[i].c_str()).c_str(), // the pattern flags, // default options @@ -428,6 +423,11 @@ std::wstring CMeasure::ExtractWord(std::wstring& buffer) buffer.erase(0, end); + if (m_RegExpSubstitute && ret.empty()) + { + ret = L"^$"; + } + return ret; }