Skip to content

Use unchecked math in encodeInteger#328

Merged
Lukasa merged 2 commits into
apple:mainfrom
Lukasa:cb-unchecked-encode
Feb 25, 2022
Merged

Use unchecked math in encodeInteger#328
Lukasa merged 2 commits into
apple:mainfrom
Lukasa:cb-unchecked-encode

Conversation

@Lukasa

@Lukasa Lukasa commented Feb 23, 2022

Copy link
Copy Markdown
Contributor

Motivation

Checked math is great when you aren't sure what the constraints are, but
in some places we happen to know that all the arithmetic operations
occur in a defined domain and range. In those cases, we can improve the
codegen by adopting unchecked math.

Modifications

Widely adopt unchecked math in encodeInteger.

Result

Better codegen for encodeInteger.

Motivation

Checked math is great when you aren't sure what the constraints are, but
in some places we happen to know that all the arithmetic operations
occur in a defined domain and range. In those cases, we can improve the
codegen by adopting unchecked math.

Modifications

Widely adopt unchecked math in encodeInteger.

Result

Better codegen for encodeInteger.
@Lukasa Lukasa added the 🔨 semver/patch No public API change. label Feb 23, 2022
@Lukasa Lukasa requested review from fabianfett and glbrntt February 23, 2022 08:56
@Lukasa

Lukasa commented Feb 23, 2022

Copy link
Copy Markdown
Contributor Author

@swift-nio-bot test this please

@Lukasa Lukasa enabled auto-merge (squash) February 23, 2022 19:41
@Lukasa Lukasa merged commit 0ad7ff6 into apple:main Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants