X-Git-Url: http://nitlanguage.org diff --git a/lib/standard/collection/list.nit b/lib/standard/collection/list.nit index ae1b675..2cdc431 100644 --- a/lib/standard/collection/list.nit +++ b/lib/standard/collection/list.nit @@ -126,20 +126,11 @@ class List[E] push(e) return end - var nnode = new ListNode[E](e) - var next = node.next - if next == null then - _tail = nnode - else - next.prev = nnode - end - nnode.prev = node - nnode.next = next - node.next = nnode + insert_before(e, node) end # Append `l` to `self` but clear `l`. - ## + # # O(1) fun link(l: List[E]) do