Click or drag to resize

RankedSetTSkip Method

Bypasses a supplied number of items and yields the remaining items.

Namespace:  Kaos.Collections
Assembly:  KaosCollections (in KaosCollections.dll) Version: 4.2.0.0
Syntax
C#
public RankedSetTEnumerator Skip(
	int count
)

Parameters

count
Type: SystemInt32
Number of items to skip.

Return Value

Type: RankedSetTEnumerator
The items after the supplied offset.
Exceptions
ExceptionCondition
InvalidOperationExceptionWhen the set was modified after the enumerator was created.
Remarks
This is a O(log n) operation.
Examples
In the below snippet, both Skip operations perform an order of magnitude faster than their LINQ equivalent.
C#
var set = new RankedSet<int>() { 295 };
for (int i = 2; i < 500; i += 2) set.Add (i);

foreach (var x in set.Skip (100).SkipWhile (i => i%2==0).Skip (100))
    Console.Write ($"{x} ");

// Output: 494 496 498
See Also