core/text: make FlatText private
[nit.git] / lib / core / text / abstract_text.nit
index 63fb920..baf8ae7 100644 (file)
@@ -146,15 +146,7 @@ abstract class Text
        # Returns -1 if not found
        #
        # DEPRECATED : Use self.chars.last_index_of_from instead
-       fun last_index_of_from(item: Char, pos: Int): Int
-       do
-               var iter = self.chars.reverse_iterator_from(pos)
-               while iter.is_ok do
-                       if iter.item == item then return iter.index
-                       iter.next
-               end
-               return -1
-       end
+       fun last_index_of_from(item: Char, pos: Int): Int do return chars.last_index_of_from(item, pos)
 
        # Gets an iterator on the chars of self
        #
@@ -974,17 +966,14 @@ abstract class Text
 end
 
 # All kinds of array-based text representations.
-abstract class FlatText
+private abstract class FlatText
        super Text
 
        # Underlying C-String (`char*`)
        #
        # Warning : Might be void in some subclasses, be sure to check
        # if set before using it.
-       private var items: NativeString is noinit
-
-       # Real items, used as cache for to_cstring is called
-       private var real_items: nullable NativeString = null
+       var items: NativeString is noinit
 
        # Returns a char* starting at position `first_byte`
        #
@@ -1001,7 +990,7 @@ abstract class FlatText
        #
        # As always, do not modify the content of the String in C code, if this is what you want
        # copy locally the char* as Nit Strings are immutable.
-       private fun fast_cstring: NativeString is abstract
+       fun fast_cstring: NativeString is abstract
 
        redef var length = 0