avoid some string aloc by using StringBuilder#2055
Merged
twsouthwick merged 3 commits intodotnet:mainfrom Apr 28, 2026
Merged
Conversation
mikeebowen
approved these changes
Apr 14, 2026
tomjebo
approved these changes
Apr 14, 2026
Test Results 81 files 81 suites 1h 32m 1s ⏱️ Results for commit 1877bd3. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull request overview
This PR reduces intermediate string allocations in semantic validation error-message construction by replacing repeated string concatenation patterns with StringBuilder.
Changes:
- Replaced concatenated string building of quoted value lists with
StringBuilderin multiple semantic constraint validators. - Removed leading-comma +
Substring(1)patterns inAttributeMutualExclusiveand replaced them with delimiter-awareStringBuilderappends.
Show a summary per file
| File | Description |
|---|---|
| src/DocumentFormat.OpenXml.Framework/Validation/Semantic/AttributeValueConditionToAnother.cs | Uses StringBuilder to build human-readable quoted value lists for validation messages. |
| src/DocumentFormat.OpenXml.Framework/Validation/Semantic/AttributeMutualExclusive.cs | Uses StringBuilder to build comma-delimited attribute lists without Substring(1) cleanup. |
| src/DocumentFormat.OpenXml.Framework/Validation/Semantic/AttributeAbsentConditionToValue.cs | Uses StringBuilder to build quoted value lists for the error description. |
| src/DocumentFormat.OpenXml.Framework/Validation/Semantic/AttributeAbsentConditionToNonValue.cs | Uses StringBuilder to build quoted value lists (with “and”) for the error description. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 0
twsouthwick
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.