Editorconfig Guide.e

Prefer compound assignment

EditorConfig key: dotnet-style-prefer-compound-assignment

Prefer compound assignment

dotnet-style-prefer-compound-assignment

This option controls whether compound assignment operators (+=, -=, ...) should be preferred over the equivalent expression.

Default value:

true

Possible values:

  • true
  • false

Examples

true
a += b;
false
a = a + b;