From 53dc13f86af71526f83d4f10ac3c78315cef436e Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 14 Apr 2012 17:46:35 +1000 Subject: Remove GoodTrailByte as it duplicated IsTrailByte. Simplified IsTrailByte. Feature #3517596. From Marko Njezic. --- src/Document.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src') 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(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(cb.CharAt(pos)); size_t widthChar = UTF8CharLength(ch); bytes[0] = ch; for (size_t i=1; i(pos+i)); - if (!GoodTrailByte(static_cast(bytes[i]))) { // Bad byte + if (!IsTrailByte(static_cast(bytes[i]))) { // Bad byte widthChar = 1; } } -- cgit v1.2.3