Skip to content

Nit: Non-short-circuiting OR in Linq #33587

@scovetta

Description

@scovetta

In Linq/Select.cs:180:

public override bool MoveNext()
{
    if (_state < 1 | _state == _source.Length + 1)
...

This looks to me like it should be a || operator instead, but a tiny part of me thinks that perhaps the TSource could implement .Length as a property and the getter could mutate the object in some important way.

Happy to submit a PR for this, but wanted to ask if this was a known pattern first, or if this was just a typo.

Metadata

Metadata

Assignees

No one assigned

    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