Skip to content

Commit 37f6299

Browse files
committed
Renamed addMove to addMoved; renamed arguments according to the style guide.
1 parent 7538244 commit 37f6299

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

changelog.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
- Added `lists.copy` for shallow copying singly- and doubly linked lists.
8686

8787
- `add` is now overloaded also for the concatenation of singly- and doubly linked lists;
88-
an O(1) variation that consumes its argument, `addMove`, is also supplied.
88+
an O(1) variation that consumes its argument, `addMoved`, is also supplied.
8989

9090
## Language changes
9191

lib/pure/collections/lists.nim

+4-4
Original file line numberDiff line numberDiff line change
@@ -704,15 +704,15 @@ proc add*[T](L1: var DoublyLinkedList[T], L2: DoublyLinkedList[T]) {.since: (1,
704704
## Appends a shallow copy of `L2` to the end of `L1`.
705705
runnableExamples:
706706
import sequtils
707-
var a = [1, 2, 3].toDoublyLinkedList
708-
let b = [4, 5].toDoublyLinkedList
707+
var a = [1, 2, 3].toSinglyLinkedList
708+
let b = [4, 5].toSinglyLinkedList
709709
a.add b
710710
assert a.toSeq == [1, 2, 3, 4, 5]
711711
assert b.toSeq == [4, 5]
712712
a.add a
713713
assert a.toSeq == [1, 2, 3, 4, 5, 1, 2, 3, 4, 5]
714-
var tmp = L2.copy
715-
L1.addMove tmp
714+
var tmp = b.copy
715+
a.addMoved tmp
716716

717717
proc remove*[T](L: var DoublyLinkedList[T], n: DoublyLinkedNode[T]) =
718718
## Removes a node `n` from `L`. Efficiency: O(1).

0 commit comments

Comments
 (0)