diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2014-05-14 19:21:19 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2014-05-14 19:49:03 +0100 |
| commit | db423e4a88be8799ce0cfae33ddbf4c6bae97e5f (patch) | |
| tree | 2cb1a4eb27117889ed1d991b3949d5792ee19dcc /src/utf8.hh | |
| parent | fbf7856e3ec40d58444d88fc9852db8e38cb68e7 (diff) | |
utf8::is_character_start takes directly the char value
Diffstat (limited to 'src/utf8.hh')
| -rw-r--r-- | src/utf8.hh | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/utf8.hh b/src/utf8.hh index 865d8705..5aac8c2a 100644 --- a/src/utf8.hh +++ b/src/utf8.hh @@ -76,17 +76,16 @@ CharCount distance(Iterator begin, Iterator end) // return true if it points to the first byte of a (either single or // multibyte) character -template<typename Iterator> -bool is_character_start(Iterator it) +inline bool is_character_start(char c) { - return (*it & 0xC0) != 0x80; + return (c & 0xC0) != 0x80; } // returns an iterator to the first byte of the character it is into template<typename Iterator> Iterator character_start(Iterator it) { - while (not is_character_start(it)) + while (not is_character_start(*it)) --it; return it; } |
