Skip to content

Performance/Detect does not work with [0] or [-1] #163

@iSarCasm

Description

@iSarCasm

Is your feature request related to a problem? Please describe.

Since for arrays [0] is usually the same as .first and [-1] is same as .last I would expect the Performance/Detect to identify performance problems with index syntax as well.

Describe the solution you'd like

Add index syntax to Performance/Detect cop

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions