diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-02-10 16:30:16 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-02-10 16:30:16 +0100 |
commit | 723b75534632a99228a7266d7579c9d8b3f0cb77 (patch) | |
tree | db1cae271ddf0723090f99f5a190ad83b986222b /src/search.cpp | |
parent | 1da5bdeb986657c5cfd83d495d15b7f2308d3b5b (diff) | |
download | sciteco-723b75534632a99228a7266d7579c9d8b3f0cb77.tar.gz |
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%.
Diffstat (limited to 'src/search.cpp')
-rw-r--r-- | src/search.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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 <CTRL/X> */ |