From: Lucas Bajolet Date: Tue, 17 Nov 2015 21:05:43 +0000 (-0500) Subject: lib/core: Allow comparison operators to work on any subclass of FlatText X-Git-Tag: v0.8~82^2~1 X-Git-Url: http://nitlanguage.org lib/core: Allow comparison operators to work on any subclass of FlatText Signed-off-by: Lucas Bajolet --- diff --git a/lib/core/text/flat.nit b/lib/core/text/flat.nit index cd8523c..4d35126 100644 --- a/lib/core/text/flat.nit +++ b/lib/core/text/flat.nit @@ -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