Skip to content

Remove redundant abs calls from Range - #15666

Merged
josevalim merged 1 commit into
elixir-lang:mainfrom
preciz:optimize-range-redundant-abs
Jul 24, 2026
Merged

Remove redundant abs calls from Range#15666
josevalim merged 1 commit into
elixir-lang:mainfrom
preciz:optimize-range-redundant-abs

Conversation

@preciz

@preciz preciz commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Assisted-by: GPT 5.6 Sol : Codex CLI

Removes redundant abs/1 calls from Range.size/1 and Range.disjoint?/2.
Range direction and normalization already guarantee the relevant values are non-negative.

Adds coverage for negative-step singletons and unaligned descending ranges.

@josevalim
josevalim merged commit 70624ef into elixir-lang:main Jul 24, 2026
13 of 15 checks passed
@josevalim

Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants