From 723b75534632a99228a7266d7579c9d8b3f0cb77 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 10 Feb 2016 16:30:16 +0100 Subject: added String::toupper(): minor optimization * This is one of the most called functions (although a cheap one), so having our own inline implementation speeds up things. Benchmarks have shown that parsing is sped up by at least 4%. --- src/search.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/search.cpp') diff --git a/src/search.cpp b/src/search.cpp index cd1ef40..3a493ff 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -210,7 +210,7 @@ StateSearch::class2regexp(MatchState &state, const gchar *&pattern, break; case STATE_CTL_E: - switch (g_ascii_toupper(*pattern)) { + switch (String::toupper(*pattern)) { case 'A': pattern++; state = STATE_START; @@ -379,7 +379,7 @@ StateSearch::pattern2regexp(const gchar *&pattern, case STATE_CTL_E: state = STATE_START; - switch (g_ascii_toupper(*pattern)) { + switch (String::toupper(*pattern)) { case 'M': state = STATE_MANY; break; case 'S': String::append(re, "\\s+"); break; /* same as */ -- cgit v1.2.3