Skip to content

Commit

Permalink
refactor: use expression bodied accessors where possible
Browse files Browse the repository at this point in the history
Getters and setters with a single statement in their bodies can be simplified using the arrow operator (`=>`). This eliminates the need for braces, thereby reducing the indentation and lines used.
  • Loading branch information
deepsource-autofix[bot] authored Nov 25, 2024
1 parent 6c791bf commit b6e95c1
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions csharp/Antipattern.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@ class Person
// Same as auto-property.
public string Name
{
get
{
return _name;
}
get => _name;

set
{
_name = value;
}
set => _name = value;
}
}

Expand Down

0 comments on commit b6e95c1

Please sign in to comment.