Skip to content

Optimization for strong zeros and broadcasting #44911

Open
@antoine-levitt

Description

@antoine-levitt

It'd be helpful to have x .+ false recognize that false is a strong zero and therefore the expression can be optimized to x. Use case is something like

if cond
    to_add = some_array
else
    to_add = false
end
# lots of code including to_add .+ some_other_array

Currently one has to put the lot of code in the if branch, which can be annoying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    broadcastApplying a function over a collection

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions