Added extendLeft
This commit is contained in:
parent
9ee6bdfb96
commit
dbcc992006
|
@ -304,6 +304,20 @@ proc extend*[T](self: LinkedDeque[T], other: seq[T]) =
|
||||||
self.add(item)
|
self.add(item)
|
||||||
|
|
||||||
|
|
||||||
|
proc extendLeft*[T](self: LinkedDeque[T], other: LinkedDeque[T]) =
|
||||||
|
## Same as self.extend(), but extends from
|
||||||
|
## the head instead of the tail
|
||||||
|
for item in other:
|
||||||
|
self.addLeft(item)
|
||||||
|
|
||||||
|
|
||||||
|
proc extendLeft*[T](self: LinkedDeque[T], other: seq[T]) =
|
||||||
|
## Same as self.extend(), but extends from
|
||||||
|
## the head instead of the tail
|
||||||
|
for item in other:
|
||||||
|
self.addLeft(item)
|
||||||
|
|
||||||
|
|
||||||
proc `$`*[T](self: LinkedDeque[T]): string =
|
proc `$`*[T](self: LinkedDeque[T]): string =
|
||||||
## Returns a string representation
|
## Returns a string representation
|
||||||
## of the deque
|
## of the deque
|
||||||
|
|
Loading…
Reference in New Issue