-
-
Notifications
You must be signed in to change notification settings - Fork 574
refactor(traverse): remove get_unique_name_impl
#10755
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(traverse): remove get_unique_name_impl
#10755
Conversation
CodSpeed Instrumentation Performance ReportMerging #10755 will not alter performanceComparing Summary
|
Warning Rate limit exceeded@graphite-app[bot] has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 9 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe changes involve refactoring in the ✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
crates/oxc_traverse/src/context/scoping.rs (2)
553-567
: Clarify single-digit postfix logic. It's intentional to skip_1
and start at_2
(aligned with the provided test cases), but this behavior may be non-obvious to future readers. Consider adding a brief comment above this block to explain why_1
is omitted.
629-753
: Test suite could be DRYed out. The exhaustive inline array of cases (especially the long sequence for 2–100) makes the file very large and harder to maintain. Consider programmatically generating numeric test cases with loops to reduce duplication.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
crates/oxc_traverse/src/context/scoping.rs
(1 hunks)
🔇 Additional comments (6)
crates/oxc_traverse/src/context/scoping.rs (6)
520-524
: Signature consolidation approved. The refactoredget_unique_name
function correctly merges the old wrapper and implementation, and the lifetimes onuid_names
andallocator
are accurate for the arena allocation model.
529-532
: Initial UID construction is correct. Preallocating capacity and pushing the underscore then base string is efficient and clear.
542-552
: Unsafe byte manipulation is sound. The safety comment correctly outlines why reinterpreting the bytes is valid, and reobtainingbytes
after each push avoids stale pointers.
569-595
: Double-digit and beyond logic looks robust. The loops correctly handle_10
through_99
and fall back to the general case.
603-622
: Extended postfix loop is reliable. Truncating and appending withItoaBuffer
covers the full range up tou32::MAX
without reallocations until necessary.
1-753
:✅ Verification successful
Ensure removal of the old wrapper is complete. We should verify there are no remaining references to
get_unique_name_impl
elsewhere in the codebase.
Provide a script to confirm:
🏁 Script executed:
#!/bin/bash # Search for any leftover invocations or imports of the old helper rg -n "get_unique_name_impl"Length of output: 28
No leftover references to
get_unique_name_impl
found
Ranrg -n "get_unique_name_impl"
across the repository and received no matches, confirming the old helper has been fully removed.
Small refactor only, so merging without review. |
Merge activity
|
Follow-on after #10562. Pure refactor. Merge `get_unique_name_impl` into `get_unique_name`.
b32e098
to
ae57125
Compare
Follow-on after #10562. Pure refactor. Merge
get_unique_name_impl
intoget_unique_name
.