Skip to content

Commit

Permalink
Simplify ShuffleTakeIterator.GetCount (#112593)
Browse files Browse the repository at this point in the history
  • Loading branch information
skyoxZ authored Feb 15, 2025
1 parent 8d06783 commit 58b068b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public override void Dispose()

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

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

0 comments on commit 58b068b

Please sign in to comment.