Skip to content

First()/Last() and xxxOrDefault() variations check for IList, not IReadOnlyList for indexed optimzation #233

@marcus-sonestedt

Description

@marcus-sonestedt

See this line as an example:

IList<TSource> list = source as IList<TSource>;

It only uses the indexing, which is the only thing IReadonlyList differs on over a collection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions