Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Aug 16, 2025

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.

@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Aug 16, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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-hq
Copy link

codspeed-hq bot commented Aug 16, 2025

CodSpeed Instrumentation Performance Report

Merging #13142 will not alter performance

Comparing 08-16-refactor_allocator_napi_parser_use_usize_is_multiple_of_ (f6ac2e6) with main (09b597f)

Summary

✅ 16 untouched benchmarks
⁉️ 18 dropped benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
⁉️ codegen[RadixUIAdoptionSection.jsx] 123.2 µs N/A N/A
⁉️ codegen[binder.ts] 4.2 ms N/A N/A
⁉️ codegen[cal.com.tsx] 34.1 ms N/A N/A
⁉️ codegen[react.development.js] 1.9 ms N/A N/A
⁉️ linter[RadixUIAdoptionSection.jsx] 2.5 ms N/A N/A
⁉️ linter[binder.ts] 146.6 ms N/A N/A
⁉️ linter[cal.com.tsx] 1.2 s N/A N/A
⁉️ linter[react.development.js] 52.3 ms N/A N/A
⁉️ estree[checker.ts] 104.5 ms N/A N/A
⁉️ parser[RadixUIAdoptionSection.jsx] 83.5 µs N/A N/A
⁉️ parser[binder.ts] 3.3 ms N/A N/A
⁉️ parser[cal.com.tsx] 26.7 ms N/A N/A
⁉️ parser[react.development.js] 1.3 ms N/A N/A
⁉️ isolated-declarations[vue-id.ts] 57.3 ms N/A N/A
⁉️ transformer[RadixUIAdoptionSection.jsx] 133 µs N/A N/A
⁉️ transformer[binder.ts] 1.7 ms N/A N/A
⁉️ transformer[cal.com.tsx] 26.8 ms N/A N/A
⁉️ transformer[react.development.js] 717.4 µs N/A N/A

@overlookmotel overlookmotel marked this pull request as ready for review August 16, 2025 14:18
Copilot AI review requested due to automatic review settings August 16, 2025 14:18
Copy link
Contributor

Copilot AI left a 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_of function with usize::is_multiple_of method
  • Removed the custom is_multiple_of function 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.

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Aug 16, 2025
Copy link
Member Author

overlookmotel commented Aug 16, 2025

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.
@graphite-app graphite-app bot force-pushed the 08-16-refactor_allocator_napi_parser_use_usize_is_multiple_of_ branch from a22df15 to f6ac2e6 Compare August 16, 2025 14:24
@graphite-app graphite-app bot merged commit f6ac2e6 into main Aug 16, 2025
23 of 27 checks passed
@graphite-app graphite-app bot deleted the 08-16-refactor_allocator_napi_parser_use_usize_is_multiple_of_ branch August 16, 2025 14:29
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants