lib/core: Allow comparison operators to work on any subclass of FlatText
authorLucas Bajolet <r4pass@hotmail.com>
Tue, 17 Nov 2015 21:05:43 +0000 (16:05 -0500)
committerLucas Bajolet <r4pass@hotmail.com>
Thu, 19 Nov 2015 18:56:55 +0000 (13:56 -0500)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

lib/core/text/flat.nit

index cd8523c..4d35126 100644 (file)
@@ -412,7 +412,7 @@ class FlatString
 
        redef fun ==(other)
        do
-               if not other isa FlatString then return super
+               if not other isa FlatText then return super
 
                if self.object_id == other.object_id then return true
 
@@ -421,7 +421,7 @@ class FlatString
                if other._bytelen != my_length then return false
 
                var my_index = _first_byte
-               var its_index = other._first_byte
+               var its_index = other.first_byte
 
                var last_iteration = my_index + my_length
 
@@ -439,7 +439,7 @@ class FlatString
 
        redef fun <(other)
        do
-               if not other isa FlatString then return super
+               if not other isa FlatText then return super
 
                if self.object_id == other.object_id then return false