aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-04-30 07:57:13 +1000
committerNeil <nyamatongwe@gmail.com>2018-04-30 07:57:13 +1000
commit40bab3e66ee2630458ca3d5fab20a94351308849 (patch)
tree5c0c5299841f45f0342cdecba8791ee51a30e761
parent06220b1501744c5cebc861e6e6e06449814b1d60 (diff)
downloadscintilla-mirror-40bab3e66ee2630458ca3d5fab20a94351308849.tar.gz
Backport: Feature [feature-requests:#1215]. Simplify RESearch::ChSetWithCase.
Backport of changeset 6759:a4ec3a347298.
-rw-r--r--src/RESearch.cxx13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/RESearch.cxx b/src/RESearch.cxx
index 85a7171f4..6d558281b 100644
--- a/src/RESearch.cxx
+++ b/src/RESearch.cxx
@@ -290,17 +290,12 @@ void RESearch::ChSet(unsigned char c) {
}
void RESearch::ChSetWithCase(unsigned char c, bool caseSensitive) {
- if (caseSensitive) {
- ChSet(c);
- } else {
+ ChSet(c);
+ if (!caseSensitive) {
if ((c >= 'a') && (c <= 'z')) {
- ChSet(c);
- ChSet(static_cast<unsigned char>(c - 'a' + 'A'));
+ ChSet(c - 'a' + 'A');
} else if ((c >= 'A') && (c <= 'Z')) {
- ChSet(c);
- ChSet(static_cast<unsigned char>(c - 'A' + 'a'));
- } else {
- ChSet(c);
+ ChSet(c - 'A' + 'a');
}
}
}