Engraving: add missing reserve()#33477
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (22)
✅ Files skipped from review due to trivial changes (17)
📝 WalkthroughWalkthroughThis pull request applies vector capacity preallocation optimizations across MuseScore's codebase. Multiple functions now call 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/engraving/dom/stringdata.cpp`:
- Around line 52-53: Guard the negative numStrings before calling
m_stringTable.reserve to avoid signed-to-size_t wraparound: check if numStrings
> 0 and only then call m_stringTable.reserve(static_cast<size_t>(numStrings));
likewise ensure the subsequent for (int i = 0; i < numStrings; i++) loop is
skipped when numStrings <= 0 (or change loop to use a size_t count variable
derived from the validated numStrings) so no huge allocation or invalid
iteration can occur.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 567cf179-412f-4060-a49d-fb553843f175
📒 Files selected for processing (23)
musesrc/engraving/dom/beam.cppsrc/engraving/dom/beambase.cppsrc/engraving/dom/chord.cppsrc/engraving/dom/excerpt.cppsrc/engraving/dom/figuredbass.cppsrc/engraving/dom/glissando.cppsrc/engraving/dom/instrument.cppsrc/engraving/dom/measure.cppsrc/engraving/dom/range.cppsrc/engraving/dom/repeatlist.cppsrc/engraving/dom/score.cppsrc/engraving/dom/scoreorder.cppsrc/engraving/dom/staff.cppsrc/engraving/dom/stafftype.cppsrc/engraving/dom/stringdata.cppsrc/engraving/dom/unrollrepeats.cppsrc/engraving/editing/editchord.cppsrc/engraving/editing/transpose.cppsrc/engraving/rendering/score/boxlayout.cppsrc/engraving/rendering/score/scorehorizontalviewlayout.cppsrc/engraving/rendering/score/tremololayout.cppsrc/engraving/types/typesconv.cpp
dc5d702 to
00d8cc8
Compare
00d8cc8 to
aaeb6d5
Compare
No description provided.