C#

C#

Made by DeepSource

IEnumerable.Skip() takes in number of elements to skip rather than the index CS-W1093

Bug risk
Critical

The Skip() method takes in an int parameter that denotes the number of elements to skip rather than the index of the element to skip. Passing in 0 to this method is the same as saying "not to skip any element". The correct syntax instead is Skip(1). Consider making the appropriate changes to ensure your program does not rely on flawed logic.

Bad Practice

var rest = elements.Skip(0);

Recommended

var rest = elements.Skip(1);

References