nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d1bd8e1
)
core: optimize Bytes::append_text using redefs in Text subclasses
author
Alexis Laferrière
<alexis.laf@xymus.net>
Fri, 8 Sep 2017 14:06:31 +0000
(10:06 -0400)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Fri, 15 Sep 2017 12:25:57 +0000
(08:25 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/core/bytes.nit
patch
|
blob
|
history
diff --git
a/lib/core/bytes.nit
b/lib/core/bytes.nit
index
41b6aa8
..
d53a76c
100644
(file)
--- a/
lib/core/bytes.nit
+++ b/
lib/core/bytes.nit
@@
-453,12
+453,8
@@
class Bytes
length += ln
end
- # Appends the bytes of `s` to `selftextextt`
- fun append_text(s: Text) do
- for i in s.substrings do
- append_ns(i.fast_cstring, i.byte_length)
- end
- end
+ # Appends the bytes of `str` to `self`
+ fun append_text(str: Text) do str.append_to_bytes self
redef fun append_to(b) do b.append self