2021-04-28 16:49:39 +02:00
|
|
|
When a closure contains only a ``++return++`` statement, the ``++return++`` itself can be omitted.
|
|
|
|
|
2021-04-28 18:08:03 +02:00
|
|
|
|
2021-04-28 16:49:39 +02:00
|
|
|
== Noncompliant Code Example
|
|
|
|
|
|
|
|
----
|
|
|
|
someList.sort { a, b in
|
|
|
|
return a > b
|
|
|
|
}
|
|
|
|
----
|
|
|
|
|
2021-04-28 18:08:03 +02:00
|
|
|
|
2021-04-28 16:49:39 +02:00
|
|
|
== Compliant Solution
|
|
|
|
|
|
|
|
----
|
|
|
|
someList.sort { a, b in a > b }
|
|
|
|
----
|
2021-04-28 18:08:03 +02:00
|
|
|
|