Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix behavior of SA1506 code fix when a blank line follows a line comment #1461

Merged
merged 2 commits into from
Sep 13, 2015

Conversation

sharwell
Copy link
Member

Fixes #1456

@sharwell sharwell added this to the 1.0.0 Beta 12 milestone Sep 12, 2015
{
triviaList = triviaList.RemoveAt(currentLineStart);
currentIndex = currentLineStart - 1;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ What is the intention for the for loop, as it will only perform a single iteration.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assignment to currentIndex should have appeared outside the loop. I replaced the loop with a call to a new extension method RemoveRange to help clarify the code.

@vweijsters
Copy link
Contributor

👍 Looks good to me

sharwell added a commit that referenced this pull request Sep 13, 2015
Fix behavior of SA1506 code fix when a blank line follows a line comment
@sharwell sharwell merged commit ed2bcba into DotNetAnalyzers:master Sep 13, 2015
@sharwell sharwell deleted the fix-1456 branch September 13, 2015 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants