aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2012-04-14 17:46:35 +1000
committernyamatongwe <unknown>2012-04-14 17:46:35 +1000
commit53dc13f86af71526f83d4f10ac3c78315cef436e (patch)
treebe2ee860d9eb7daa7d6951b7dad681ee28620c07 /src
parentae37158b2068fb3fb67adcfddaafc8b0b935090b (diff)
downloadscintilla-mirror-53dc13f86af71526f83d4f10ac3c78315cef436e.tar.gz
Remove GoodTrailByte as it duplicated IsTrailByte. Simplified IsTrailByte. Feature #3517596.
From Marko Njezic.
Diffstat (limited to 'src')
-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;
}
}