Editorconfig Guide.e

Prefer tuple swap

EditorConfig key: csharp-style-prefer-tuple-swap

Prefer tuple swap

csharp-style-prefer-tuple-swap

This option controls whether tuple swapping should be preferred over using a temporary variable to swap two values.

Default value:

true

Possible values:

  • true
  • false

Examples

true
(x, y) = (y, x);
false
var temp = x;
x = y;
y = temp;