nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
loader: build_module_importation invalidates the mmodule on errors
[nit.git]
/
examples
/
circular_list.nit
diff --git
a/examples/circular_list.nit
b/examples/circular_list.nit
index
c3ba1ed
..
dd4e54d
100644
(file)
--- a/
examples/circular_list.nit
+++ b/
examples/circular_list.nit
@@
-120,11
+120,11
@@
end
private class CircularListIterator[E]
super IndexedIterator[E]
private class CircularListIterator[E]
super IndexedIterator[E]
- redef var index: Int
+ redef var index: Int = 0
# The current node pointed.
# Is null if the list is empty.
# The current node pointed.
# Is null if the list is empty.
- var node: nullable CLNode[E]
+ var node: nullable CLNode[E] is noinit
# The list iterated.
var list: CircularList[E]
# The list iterated.
var list: CircularList[E]
@@
-144,11
+144,9
@@
private class CircularListIterator[E]
redef fun item do return self.node.item
redef fun item do return self.node.item
- init(list: CircularList[E])
+ init
do
self.node = list.node
do
self.node = list.node
- self.list = list
- self.index = 0
end
end
end
end