Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4cfdb41

Browse files
forkiKevinRansom
authored andcommitted
Fix num bug in QueueList -fixesdotnet#4722 (dotnet#4727)
1 parent41b9f61 commit4cfdb41

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/fsharp/QueueList.fs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ type internal QueueList<'T>(firstElementsIn:'T list, lastElementsRevIn: 'T list,
3434

3535
/// This operation is O(1), unless a push happens, which is rare.
3636
memberx.AppendOne(y)= QueueList(firstElements, y:: lastElementsRev, numLastElements+1)
37-
memberx.Append(ys:seq<_>)= QueueList(firstElements,(List.rev(Seq.toList ys)@ lastElementsRev), numLastElements+1)
37+
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)
3842

3943
/// This operation is O(n) anyway, so executing ToList() here is OK
4044
interface IEnumerable<'T>with

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp