nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
da8394e
)
lib/binary: Fix binary lib to properly use Bytes instead of FlatBuffer
author
Lucas Bajolet
<r4pass@hotmail.com>
Tue, 11 Aug 2015 20:53:59 +0000
(16:53 -0400)
committer
Lucas Bajolet
<r4pass@hotmail.com>
Thu, 20 Aug 2015 14:50:47 +0000
(10:50 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
lib/binary/binary.nit
patch
|
blob
|
history
diff --git
a/lib/binary/binary.nit
b/lib/binary/binary.nit
index
263ad95
..
7e5c180
100644
(file)
--- a/
lib/binary/binary.nit
+++ b/
lib/binary/binary.nit
@@
-178,11
+178,13
@@
redef abstract class Reader
# Returns a truncated string when an error is pending (`last_error != null`).
fun read_string: String
do
- var buf = new FlatBuffer
+ var buf = new Bytes.empty
loop
var byte = read_byte
- if byte == null or byte == 0x00u8 then return buf.to_s
- buf.bytes.add byte
+ if byte == null or byte == 0u8 then
+ return buf.to_s
+ end
+ buf.add byte
end
end