lib/string: make FlatString#chars lazy
authorJean Privat <jean@pryen.org>
Fri, 6 Mar 2015 03:54:47 +0000 (10:54 +0700)
committerJean Privat <jean@pryen.org>
Fri, 6 Mar 2015 04:20:55 +0000 (11:20 +0700)
Signed-off-by: Jean Privat <jean@pryen.org>

lib/standard/string.nit

index 88c4074..6a9f521 100644 (file)
@@ -1052,7 +1052,7 @@ class FlatString
        # Indes in _items of the last item of the string
        private var index_to: Int is noinit
 
-       redef var chars: SequenceRead[Char] = new FlatStringCharView(self)
+       redef var chars: SequenceRead[Char] = new FlatStringCharView(self) is lazy
 
        redef fun [](index)
        do
@@ -1522,7 +1522,7 @@ class FlatBuffer
        super FlatText
        super Buffer
 
-       redef var chars: Sequence[Char] = new FlatBufferCharView(self)
+       redef var chars: Sequence[Char] = new FlatBufferCharView(self) is lazy
 
        private var capacity: Int = 0