nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nullable: convert lib, tools and tests
[nit.git]
/
lib
/
standard
/
list.nit
diff --git
a/lib/standard/list.nit
b/lib/standard/list.nit
index
97caba4
..
6a0fd19
100644
(file)
--- a/
lib/standard/list.nit
+++ b/
lib/standard/list.nit
@@
-179,13
+179,13
@@
special IndexedCollection[E]
init from(coll: Collection[E]) do append(coll)
# The first node of the list
init from(coll: Collection[E]) do append(coll)
# The first node of the list
- attr _head: ListNode[E]
+ attr _head: nullable ListNode[E]
# The last node of the list
# The last node of the list
- attr _tail: ListNode[E]
+ attr _tail: nullable ListNode[E]
# Get the `i'th node. get `null' otherwise.
# Get the `i'th node. get `null' otherwise.
- private meth get_node(i: Int): ListNode[E]
+ private meth get_node(i: Int): nullable ListNode[E]
do
var n = _head
if i < 0 then
do
var n = _head
if i < 0 then
@@
-199,7
+199,7
@@
special IndexedCollection[E]
end
# get the first node that contains e after 'after', null otherwise
end
# get the first node that contains e after 'after', null otherwise
- private meth search_node_after(e: E, after: ListNode[E]): ListNode[E]
+ private meth search_node_after(e: E, after: nullable ListNode[E]): nullable ListNode[E]
do
var n = after
while n != null and n.item != e do n = n.next
do
var n = after
while n != null and n.item != e do n = n.next
@@
-256,14
+256,14
@@
special IndexedIterator[E]
end
# Build a new iterator from `node'.
end
# Build a new iterator from `node'.
- private init(node: ListNode[E])
+ private init(node: nullable ListNode[E])
do
_node = node
_index = 0
end
# The current node of the list
do
_node = node
_index = 0
end
# The current node of the list
- attr _node: ListNode[E]
+ attr _node: nullable ListNode[E]
# The index of the current node
redef readable attr _index: Int
# The index of the current node
redef readable attr _index: Int
@@
-278,8
+278,8
@@
special Container[E]
end
# The next node.
end
# The next node.
- readable writable attr _next: ListNode[E]
+ readable writable attr _next: nullable ListNode[E]
# The previous node.
# The previous node.
- readable writable attr _prev: ListNode[E]
+ readable writable attr _prev: nullable ListNode[E]
end
end