Skip to content

correctly compare numeric prerelease values larger than int64 - #212

Merged
tgross merged 1 commit into
mainfrom
numeric-prerelease-comparisons
Sep 3, 2026
Merged

tgross merged 1 commit into
mainfrom
numeric-prerelease-comparisons

Conversation

@tgross

@tgross tgross commented Sep 3, 2026

Copy link
Copy Markdown
Member

Update the comparison function for prerelease segments so that we're comparing numeric identifiers larger than int64 correctly. Because we're only trying to compare them, we don't actually need to convert these to bignums, so do a lexicographical sort to avoid pulling in math/bigint.

Fixes: #204

Contributor Checklist

  • LLM Usage n/a. I'm mainly making this PR not because we particularly care about this bug but so that we stop getting eager LLM-drivers trying to goose their GitHub reputation with it

Update the comparison function for prerelease segments so that we're comparing
numeric identifiers larger than int64 correctly. Because we're only trying to
compare them, we don't actually need to convert these to bignums, so do a
lexicographical sort to avoid pulling in `math/bigint`.

Fixes: #204
@tgross
tgross requested a review from a team as a code owner September 3, 2026 15:57
@tgross
tgross requested review from gulducat and jrasell September 3, 2026 15:57
@tgross
tgross merged commit 4f9dad4 into main Sep 3, 2026
4 checks passed
@tgross
tgross deleted the numeric-prerelease-comparisons branch September 3, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Numeric prerelease identifiers larger than int64 are ordered incorrectly

2 participants