JetBrains Rider 2024.1 Help

Code Inspection: Empty statement is redundant

Category

Common Practices and Code Improvements

ID

EmptyStatement

EditorConfig

resharper_empty_statement_highlighting

Default severity

Warning

Language

C#

Requires SWA

No

JetBrains Rider detects empty statements ; that are used in a context where they are not necessary. An example of a redundant empty statement is an empty statement within a block. To improve code readability, JetBrains Rider suggests removing redundant empty statements.

while (DoSomething()) ; // empty statement is required by the context while (DoSomething()) { ; // empty statement is redundant }
Last modified: 17 April 2024