lib/core: Faster access to length in ropes
[nit.git] / lib / core / text / ropes.nit
index 84afa5b..10c1acf 100644 (file)
@@ -115,6 +115,8 @@ private class Concat
                _bytelen = l.bytelen + r.bytelen
        end
 
+       redef fun is_empty do return _bytelen == 0
+
        redef fun output do
                _left.output
                _right.output
@@ -170,7 +172,7 @@ private class Concat
                        from = 0
                end
 
-               var ln = length
+               var ln = _length
                if (count + from) > ln then count = ln - from
                if count <= 0 then return ""
                var end_index = from + count - 1