nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
984e6f2
)
lib/core: Added shortcut for common ASCII-case in `find_beginning_of_char_at`
author
Lucas Bajolet
<r4pass@hotmail.com>
Tue, 8 Dec 2015 18:20:43 +0000
(13:20 -0500)
committer
Lucas Bajolet
<r4pass@hotmail.com>
Tue, 29 Dec 2015 04:49:28 +0000
(23:49 -0500)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
lib/core/text/native.nit
patch
|
blob
|
history
diff --git
a/lib/core/text/native.nit
b/lib/core/text/native.nit
index
fad3ae1
..
a8bbc4b
100644
(file)
--- a/
lib/core/text/native.nit
+++ b/
lib/core/text/native.nit
@@
-238,6
+238,7
@@
extern class NativeString `{ char* `}
fun find_beginning_of_char_at(pos: Int): Int do
var endpos = pos
var c = self[pos]
+ if c & 0x80u8 == 0x00u8 then return pos
while c & 0xC0u8 == 0x80u8 do
pos -= 1
c = self[pos]