Skip to content

Commit 2bb54ed

Browse files
olcayRon Petrusha
authored andcommitted
Simplified interface example (#6243)
The condition is enough to return.
1 parent e9fab87 commit 2bb54ed

File tree

1 file changed

+4
-9
lines changed
  • docs/csharp/programming-guide/classes-and-structs/codesnippet/CSharp

1 file changed

+4
-9
lines changed

docs/csharp/programming-guide/classes-and-structs/codesnippet/CSharp/interfaces_2.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@ public class Car : IEquatable<Car>
77
// Implementation of IEquatable<T> interface
88
public bool Equals(Car car)
99
{
10-
if (this.Make == car.Make &&
11-
this.Model == car.Model &&
12-
this.Year == car.Year)
13-
{
14-
return true;
15-
}
16-
else
17-
return false;
10+
return this.Make == car.Make &&
11+
this.Model == car.Model &&
12+
this.Year == car.Year;
1813
}
19-
}
14+
}

0 commit comments

Comments
 (0)