rspec/rules/S3255/rule.adoc

34 lines
497 B
Plaintext
Raw Normal View History

The use of the ``++this++`` keyword is only required when the member is shadowed by a local parameter, or variable. In other cases, the code should be simplified by its removal.
== Noncompliant Code Example
2022-02-04 17:28:24 +01:00
[source,text]
----
public class MyClass
{
private int count;
public void DoSomething() {
this.count++; // Noncompliant
}
}
----
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,text]
----
public class MyClass
{
private int count;
public void DoSomething() {
count++;
}
}
----