nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1eab0bf
)
lib/standard/ropes: Adapted == method for Ropes since the == method from Collection...
author
Lucas Bajolet
<r4pass@hotmail.com>
Thu, 5 Jun 2014 14:37:48 +0000
(10:37 -0400)
committer
Lucas Bajolet
<r4pass@hotmail.com>
Thu, 5 Jun 2014 18:17:07 +0000
(14:17 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
lib/standard/ropes.nit
patch
|
blob
|
history
diff --git
a/lib/standard/ropes.nit
b/lib/standard/ropes.nit
index
40d531b
..
f69b547
100644
(file)
--- a/
lib/standard/ropes.nit
+++ b/
lib/standard/ropes.nit
@@
-154,6
+154,17
@@
abstract class Rope
end
end
+ redef fun ==(o)
+ do
+ if not o isa Text then return false
+ if o.length != self.length then return false
+ var oit = o.chars.iterator
+ for i in self.chars.iterator do
+ if i != oit.item then return false
+ oit.next
+ end
+ return true
+ end
end
# Rope that cannot be modified