Skip to content

Commit 32f667a

Browse files
committed
Fix warnings.
1 parent 4599df9 commit 32f667a

5 files changed

Lines changed: 3 additions & 22 deletions

File tree

AspNetCoreAnalyzers.Tests/Helpers/SpanTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ class C
5757
[TestCase("\"abc\"", "bc", true)]
5858
[TestCase("\"abc\"", "c", true)]
5959
[TestCase("\"abc\"", "ab", false)]
60-
[TestCase("\"abc\"", "bc", false)]
6160
[TestCase("\"abc\"", "dabc", false)]
6261
public void EndsWith(string text, string value, bool expected)
6362
{

AspNetCoreAnalyzers.Tests/Helpers/UrlTemplateTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public async Task<IActionResult> GetOrder([FromRoute]int id)
6464
var segment = template.Path.Single(x => x.Parameter.HasValue);
6565

6666
Assert.AreEqual(expected.Single(x => x.StartsWith("{", StringComparison.Ordinal)), segment.Span.ToString());
67-
Assert.AreEqual("id", segment.Parameter.Value.Name.ToString());
67+
Assert.AreEqual("id", segment.Parameter?.Name.ToString());
6868
}
6969

7070
[TestCase("\"orders/{id}\"", new[] { "orders", "{id}" }, new string[0])]

AspNetCoreAnalyzers/CodeFixes/TemplateTextFix.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
3535
context.RegisterCodeFix(
3636
CodeAction.Create(
3737
GetTitle(diagnostic),
38-
_ => Fix(_)),
38+
_ => Fix(_),
39+
equivalenceKey: null),
3940
diagnostic);
4041

4142
async Task<Document> Fix(CancellationToken cancellationToken)

AspNetCoreAnalyzers/Helpers/Span.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ internal bool EndsWith(string value, StringComparison comparisonType)
127127
return this.Literal.ValueText.IndexOf(value, start, value.Length, comparisonType) == start;
128128
}
129129

130-
131130
return false;
132131
}
133132
}

AspNetCoreAnalyzers/Helpers/Text.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@ namespace AspNetCoreAnalyzers
22
{
33
public static class Text
44
{
5-
public static void SkipWhiteSpace(Span text, ref int pos)
6-
{
7-
while (pos < text.Length &&
8-
text[pos] == ' ')
9-
{
10-
pos++;
11-
}
12-
}
13-
145
public static void SkipWhiteSpace(string text, ref int pos)
156
{
167
while (pos < text.Length &&
@@ -56,15 +47,6 @@ public static bool TrySkipPast(string text, ref int pos, string substring)
5647
return false;
5748
}
5849

59-
public static void BackWhiteSpace(Span text, ref int pos)
60-
{
61-
while (pos >= 0 &&
62-
text[pos] == ' ')
63-
{
64-
pos--;
65-
}
66-
}
67-
6850
private static bool IsAt(Span text, int pos, string substring)
6951
{
7052
for (var i = 0; i < substring.Length; i++)

0 commit comments

Comments
 (0)