Skip to content

Avoid redundant strlen - #49

Merged
kimkulling merged 2 commits into
mainfrom
bugfix/avoid_doubled_strlen
Aug 18, 2026
Merged

Avoid redundant strlen#49
kimkulling merged 2 commits into
mainfrom
bugfix/avoid_doubled_strlen

Conversation

@kimkulling

@kimkulling kimkulling commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Bug Fixes
    • Improved text rendering calculations for more consistent message sizing and right-aligned positioning.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kimkulling, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Limit details: You’ve used all 1 included review currently available under your plan.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 35f87caf-64ed-4964-b0c9-29c979d0f719

📥 Commits

Reviewing files that changed from the base of the PR and between 511b30f and 360e5b3.

📒 Files selected for processing (6)
  • README.md
  • contrib/vcpkg
  • src/backends/sdl2_renderer.cpp
  • src/backends/sdl2_renderer.h
  • src/tinyui.h
  • src/widgets.cpp

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eff3fb6c-d04e-49cd-9469-79124eecad45

📥 Commits

Reviewing files that changed from the base of the PR and between c6f0a8a and 511b30f.

📒 Files selected for processing (1)
  • src/backends/sdl2_renderer.cpp

Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review.


Walkthrough

Renderer::drawText now computes the text length once and reuses it for all alignment calculations. Rendering behavior remains unchanged.

Changes

SDL2 text rendering

Layer / File(s) Summary
Reuse cached text length
src/backends/sdl2_renderer.cpp
drawText stores strlen(string) in stringLen and uses it for left, center, and right alignment rectangle calculations.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 511b3

This localized optimization does not present an actionable merge-blocking risk; it is merge-ready after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: avoiding a redundant strlen computation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/avoid_doubled_strlen

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

sonarqubecloud Bot commented Aug 18, 2026

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
1 Accepted issue

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@kimkulling
kimkulling merged commit 95e7a7d into main Aug 18, 2026
4 checks passed
@kimkulling
kimkulling deleted the bugfix/avoid_doubled_strlen branch August 18, 2026 09:21
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.

2 participants