aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2012-04-14 17:46:35 +1000
committernyamatongwe <devnull@localhost>2012-04-14 17:46:35 +1000
commitff03c11dadbe31808500ec5412e70c06fb983026 (patch)
treefcaa453f704e9c8c69ae8f0d27d0a23d3e19d61c
parenteed723ed2430aacf1f6a5ee687f690eb65cfea81 (diff)
downloadscintilla-mirror-ff03c11dadbe31808500ec5412e70c06fb983026.tar.gz
Remove GoodTrailByte as it duplicated IsTrailByte. Simplified IsTrailByte. Feature #3517596.
From Marko Njezic.
-rw-r--r--src/Document.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index 5ad558b8b..8e8d23059 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -470,8 +470,8 @@ int Document::LenChar(int pos) {
}
}
-static bool IsTrailByte(int ch) {
- return (ch >= 0x80) && (ch < (0x80 + 0x40));
+static inline bool IsTrailByte(int ch) {
+ return (ch >= 0x80) && (ch < 0xc0);
}
static int BytesFromLead(int leadByte) {
@@ -1385,17 +1385,13 @@ static inline char MakeLowerCase(char ch) {
return static_cast<char>(ch - 'A' + 'a');
}
-static bool GoodTrailByte(int v) {
- return (v >= 0x80) && (v < 0xc0);
-}
-
size_t Document::ExtractChar(int pos, char *bytes) {
unsigned char ch = static_cast<unsigned char>(cb.CharAt(pos));
size_t widthChar = UTF8CharLength(ch);
bytes[0] = ch;
for (size_t i=1; i<widthChar; i++) {
bytes[i] = cb.CharAt(static_cast<int>(pos+i));
- if (!GoodTrailByte(static_cast<unsigned char>(bytes[i]))) { // Bad byte
+ if (!IsTrailByte(static_cast<unsigned char>(bytes[i]))) { // Bad byte
widthChar = 1;
}
}