Skip to content

fix(math): remove redundant allocations in MinInt and MaxInt - #26781

Open
Radovenchyk wants to merge 1 commit into
cosmos:mainfrom
Radovenchyk:fix/minint-maxint-aliasing
Open

fix(math): remove redundant allocations in MinInt and MaxInt#26781
Radovenchyk wants to merge 1 commit into
cosmos:mainfrom
Radovenchyk:fix/minint-maxint-aliasing

Conversation

@Radovenchyk

@Radovenchyk Radovenchyk commented Aug 27, 2026

Copy link
Copy Markdown

Removes a redundant allocation in MinInt and MaxInt the min/max helpers already return a fresh big.Int copy, so the extra new(big.Int).Set(...) wrapper was unnecessary. The result still doesn't share its internal pointer with the inputs (verified by TestMinMaxIntAliasing).

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@Radovenchyk
Radovenchyk force-pushed the fix/minint-maxint-aliasing branch from 387d7ec to a9af62a Compare August 27, 2026 10:02
Fix aliasing bug in MinInt and MaxInt — result no longer shares
internal pointer with inputs.
@Radovenchyk
Radovenchyk force-pushed the fix/minint-maxint-aliasing branch from a9af62a to 276b1c3 Compare August 27, 2026 10:10
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.

1 participant