Skip to content

refactor(string): iterate code units directly#3675

Merged
bobzhang merged 1 commit into
mainfrom
refactor-string-code-units-iteration
Jun 8, 2026
Merged

refactor(string): iterate code units directly#3675
bobzhang merged 1 commit into
mainfrom
refactor-string-code-units-iteration

Conversation

@Yu-zh

@Yu-zh Yu-zh commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace simple index-based string and string-view code-unit loops with direct for .. in code_units() iteration.
  • Keep index variables only where they are still needed for output positions or slicing.
  • Leave allocation-sensitive hashing and low-level string blit paths indexed.

Test Plan

  • moon fmt
  • moon check
  • moon test (6521/6521 passed)
  • moon info

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 4648

Coverage remained the same at 94.247%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 1 uncovered change across 1 file (24 of 25 lines covered, 96.0%).
  • 1 coverage regression across 1 file.

Uncovered Changes

File Changed Covered %
encoding/base64/decode.mbt 6 5 83.33%
Total (8 files) 25 24 96.0%

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
encoding/base64/decode.mbt 1 85.0%

Coverage Stats

Coverage Status
Relevant Lines: 15869
Covered Lines: 14956
Line Coverage: 94.25%
Coverage Strength: 198649.58 hits per line

💛 - Coveralls

@Yu-zh

Yu-zh commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d3e8d4dbd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread encoding/base64/decode.mbt
Comment thread encoding/base64/decode.mbt
@bobzhang bobzhang merged commit 76c98c9 into main Jun 8, 2026
18 checks passed
@bobzhang bobzhang deleted the refactor-string-code-units-iteration branch June 8, 2026 13:47
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.

3 participants