Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information