Skip to content

TemplateEnumerator - Skip fast forward to first hole#6157

Merged
snakefoot merged 1 commit into
NLog:devfrom
snakefoot:TemplatePerformance
Apr 18, 2026
Merged

TemplateEnumerator - Skip fast forward to first hole#6157
snakefoot merged 1 commit into
NLog:devfrom
snakefoot:TemplatePerformance

Conversation

@snakefoot
Copy link
Copy Markdown
Contributor

@snakefoot snakefoot commented Apr 18, 2026

Followup to #6152

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: cc12558f-4993-4cdf-85fc-671ef48ae9fc

📥 Commits

Reviewing files that changed from the base of the PR and between 0b99ee0 and 8895d3e.

📒 Files selected for processing (1)
  • src/NLog/MessageTemplates/TemplateEnumerator.cs

Walkthrough

The TemplateEnumerator constructor was simplified to initialize position and literal length to zero, deferring all template delimiter detection to the MoveNext() method instead of performing upfront scanning during construction.

Changes

Cohort / File(s) Summary
Constructor Simplification
src/NLog/MessageTemplates/TemplateEnumerator.cs
Removed early delimiter detection logic from constructor; now initializes _position and _literalLength to zero and delegates all parsing to MoveNext().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A constructor once scanned from the start,
Now defers its work with a lighter heart—
Each delimiter found when MoveNext() is called,
The refactoring hops through the template, enthralled! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess relevance to the changeset. Add a pull request description explaining the motivation and benefits of deferring delimiter detection to the MoveNext() parsing loop.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: deferring delimiter detection instead of fast-forwarding to find the first hole.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

@sonarqubecloud
Copy link
Copy Markdown

@snakefoot snakefoot merged commit 89b350e into NLog:dev Apr 18, 2026
6 of 7 checks passed
@snakefoot snakefoot added this to the 6.1.3 milestone May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant