Skip to content

Commit 58b068b

Browse files
authored
Simplify ShuffleTakeIterator.GetCount (#112593)
1 parent 8d06783 commit 58b068b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libraries/System.Linq/src/System/Linq/Shuffle.SpeedOpt.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public override void Dispose()
146146

147147
public override int GetCount(bool onlyIfCheap) =>
148148
TryGetNonEnumeratedCount(_source, out int count) ? Math.Min(_takeCount, count) :
149-
!onlyIfCheap ? Math.Min(_takeCount, _source.Take(_takeCount).Count()) :
149+
!onlyIfCheap ? _source.Take(_takeCount).Count() :
150150
-1;
151151

152152
public override TSource? TryGetFirst(out bool found) =>

0 commit comments

Comments
 (0)