Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fast-lanes for '++'/2 and '--'/2 on nil arguments #8743

Merged
merged 1 commit into from
Sep 10, 2024

Commits on Aug 28, 2024

  1. Add fast-lanes for '++'/2 and '--'/2 on nil arguments

    Currently appending an empty list to another list causes the left-hand
    side list to be fully copied. We can skip the append operation when the
    right-hand side is nil since it shouldn't change the left-hand side
    list. In this fast-lane we scan the list to determine if it is improper
    so that cases like `[1, 2 | 3] ++ []` behave the same as cases like
    `[1, 2 | 3] ++ [4]`: return a badarg error.
    
    This patch adds similar fast-lanes for '--'/2: we can return the first
    argument when either the first or second arguments are nil.
    the-mikedavis committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    8eeb95d View commit details
    Browse the repository at this point in the history