Click or drag to resize

RankedDictionaryTKey, TValueValueCollectionEnumeratorSkip Method

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

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

Parameters

count
Type: SystemInt32
Number of values to skip.

Return Value

Type: RankedDictionaryTKey, TValueValueCollectionEnumerator
The values after the supplied offset.
Exceptions
ExceptionCondition
InvalidOperationExceptionWhen the dictionary 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 daryv = new RankedMap<int,int>() { { 295,-295 } };
for (int i = 2; i < 500; i += 2) daryv.Add (i,-i);

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

// Output: -494 -496 -498
See Also