Skip to content

Commit

Permalink
Fix a couple uses
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed Dec 2, 2022
1 parent 9175aac commit 3b3a98b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private static int CompareEraRanges(EraInfo a, EraInfo b)
ReadOnlySpan<char> eraName = dataSpan[names[0]];
ReadOnlySpan<char> abbreviatedEraName = dataSpan[names[1]];
ReadOnlySpan<char> englishEraName = dataSpan[names[2]];
ReadOnlySpan<char> abbreviatedEnglishEraName = dataSpan[names[2]];
ReadOnlySpan<char> abbreviatedEnglishEraName = dataSpan[names[3]];

// Each part should have data in it
if (!eraName.IsEmpty && !abbreviatedEraName.IsEmpty && !englishEraName.IsEmpty && !abbreviatedEnglishEraName.IsEmpty)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private Version ParseVersion(string attributeValue)
ReadOnlySpan<char> attributeValueSpan = attributeValue;
Span<Range> parts = stackalloc Range[5];
parts = parts.Slice(0, attributeValueSpan.Split(parts, '.'));
if (parts.Length is not (3 or 4))
if (parts.Length is < 2 or > 4)
{
ThrowInvalidAssemblyName();
}
Expand Down

0 comments on commit 3b3a98b

Please sign in to comment.