Skip to content

Remove the flooring step from list accesses when index is integer #286

@GarboMuffin

Description

@GarboMuffin
Image

Top one:

(b0.value[(b0.value.length | 0) - 1] ?? "")

Bottom one:

(b0.value[b0.value.length - 1] ?? "")

Ideally these should compile to the same thing since we can know that the length is always an integer, so the |0 is unnecessary

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceIdeas for improving performance

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions