-
-
Notifications
You must be signed in to change notification settings - Fork 723
refactor(allocator, napi/parser): use usize::is_multiple_of
#13142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(allocator, napi/parser): use usize::is_multiple_of
#13142
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Instrumentation Performance ReportMerging #13142 will not alter performanceComparing Summary
Benchmarks breakdown
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors two files to use the standard library's usize::is_multiple_of method instead of a custom is_multiple_of function. The change modernizes the codebase to leverage a standard library feature that is now available in the minimum supported Rust version (MSRV).
- Replaced all calls to custom
is_multiple_offunction withusize::is_multiple_ofmethod - Removed the custom
is_multiple_offunction implementations from both files
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| napi/parser/src/raw_transfer.rs | Updated alignment checks to use standard library method and removed custom function |
| crates/oxc_allocator/src/from_raw_parts.rs | Updated alignment checks to use standard library method and removed custom function |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Merge activity
|
Pure refactor. When this code was written, `usize::is_multiple_of` was not available in our MSRV. Now it is, so use it instead of writing the same function ourselves.
a22df15 to
f6ac2e6
Compare

Pure refactor. When this code was written,
usize::is_multiple_ofwas not available in our MSRV. Now it is, so use it instead of writing the same function ourselves.