We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent41b9f61 commit4cfdb41Copy full SHA for 4cfdb41
src/fsharp/QueueList.fs
@@ -34,7 +34,11 @@ type internal QueueList<'T>(firstElementsIn:'T list, lastElementsRevIn: 'T list,
34
35
/// This operation is O(1), unless a push happens, which is rare.
36
memberx.AppendOne(y)= QueueList(firstElements, y:: lastElementsRev, numLastElements+1)
37
-memberx.Append(ys:seq<_>)= QueueList(firstElements,(List.rev(Seq.toList ys)@ lastElementsRev), numLastElements+1)
+memberx.Append(ys:seq<_>)=
38
+letnewElements= Seq.toList ys
39
+letnewLength= List.length newElements
40
+letlastElementsRevIn= List.rev newElements@ lastElementsRev
41
+ QueueList(firstElements, lastElementsRevIn, numLastElementsIn+ newLength)
42
43
/// This operation is O(n) anyway, so executing ToList() here is OK
44
interface IEnumerable<'T>with