style: idiomatic cleanups in metadata build tooling - #413
Merged
Conversation
- Replace the manual whitespace-stripping char loop in ValidateRE with a LINQ filter. - Simplify ArePossibleLengthsEqual to a single SequenceEqual call against PhoneNumberDesc.PossibleLengthList. - Use is null / is not null instead of == null / != null throughout. No behavior change; BuildMetadataFromBin.cs was reviewed but left untouched since its field-by-field read/write order is deliberately explicit and order-sensitive.
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (86.66%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #413 +/- ##
==========================================
+ Coverage 87.42% 87.45% +0.02%
==========================================
Files 41 41
Lines 3856 3841 -15
Branches 990 983 -7
==========================================
- Hits 3371 3359 -12
+ Misses 283 281 -2
+ Partials 202 201 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
5 tasks
📊 Benchmark Results
PR branch
PR base
|
This was referenced Aug 26, 2026
This was referenced Aug 28, 2026
Closed
Open
Merged
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.
Summary
Small readability pass over
BuildMetadataFromXml.cs, part of a broader sweep to bring the C# port's style up to date file-by-file (same spirit as #409).ValidateRE: replaced the manual whitespace-stripping char loop with a LINQ filter.ArePossibleLengthsEqual: collapsed the manual index loop into a singleSequenceEqualcall againstPhoneNumberDesc.PossibleLengthList(both sides are already sorted, per the existing comment).is null/is not nullinstead of== null/!= nullthroughout.BuildMetadataFromBin.cswas reviewed too but deliberately left untouched — its field-by-field binary read/write order is explicit and order-sensitive by design (see its own doc comment), and "idiomatic" restructuring there is a correctness risk for no real readability gain.No behavior change.
Test plan
dotnet build csharp/PhoneNumbers.slnx— 0 warnings, 0 errorsdotnet test csharp/PhoneNumbers.slnx— 414/414 passing on net8.0 and net10.0