nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
909bdb3
)
lib/standard/ropes: Adapted write for performance with other String representations.
author
Lucas Bajolet
<r4pass@hotmail.com>
Mon, 9 Jun 2014 15:58:44 +0000
(11:58 -0400)
committer
Lucas Bajolet
<r4pass@hotmail.com>
Mon, 9 Jun 2014 15:58:44 +0000
(11:58 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
lib/standard/file.nit
patch
|
blob
|
history
diff --git
a/lib/standard/file.nit
b/lib/standard/file.nit
index
27b2626
..
f82a1fd
100644
(file)
--- a/
lib/standard/file.nit
+++ b/
lib/standard/file.nit
@@
-16,7
+16,7
@@
module file
intrude import stream
-intrude import string
+intrude import ropes
import string_search
import time
@@
-134,7
+134,11
@@
class OFStream
redef fun write(s)
do
assert _writable
- write_native(s.to_cstring, s.length)
+ if s isa FlatText then
+ write_native(s.to_cstring, s.length)
+ else
+ for i in s.substrings do write_native(i.to_cstring, i.length)
+ end
end
redef fun is_writable do return _writable