Skip to content

Commit c1c420d

Browse files
committed
Fix IDE0054 Use compound assignment
1 parent 0c5c03d commit c1c420d

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/DocumentationRules/FileHeaderCodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ private static SyntaxNode ReplaceHeader(Document document, SyntaxNode root, Styl
316316
// Does the copyright element have leading whitespace? If so remove it.
317317
if ((copyrightTriviaIndex.Value > 0) && trivia[copyrightTriviaIndex.Value - 1].IsKind(SyntaxKind.WhitespaceTrivia))
318318
{
319-
copyrightTriviaIndex = copyrightTriviaIndex - 1;
319+
copyrightTriviaIndex--;
320320
trivia = trivia.RemoveAt(copyrightTriviaIndex.Value);
321321
}
322322

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/NamingRules/RenameToUpperCaseCodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Task<Document> RenameNamespace(CancellationToken cancellationToken)
9696
&& !await RenameHelper.IsValidNewMemberNameAsync(semanticModel, declaredSymbol, newName, context.CancellationToken).ConfigureAwait(false))
9797
{
9898
usedSuffix = true;
99-
newName = newName + Suffix;
99+
newName += Suffix;
100100
}
101101

102102
int index = 0;

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/SpacingRules/SA1027CodeFixProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private static TextChange FixDiagnostic(IndentationSettings indentationSettings,
8686
{
8787
if (useTabs)
8888
{
89-
replacement.Length = replacement.Length - spaceCount;
89+
replacement.Length -= spaceCount;
9090
replacement.Append('\t');
9191
spaceCount = 0;
9292
}
@@ -113,7 +113,7 @@ private static TextChange FixDiagnostic(IndentationSettings indentationSettings,
113113
if (offsetWithinTabColumn == 0)
114114
{
115115
// We reached a tab stop.
116-
replacement.Length = replacement.Length - spaceCount;
116+
replacement.Length -= spaceCount;
117117
replacement.Append('\t');
118118
spaceCount = 0;
119119
}

0 commit comments

Comments
 (0)