18 lines
309 B
Plaintext
18 lines
309 B
Plaintext
include::../description.adoc[]
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
func canVote(person:Person) -> Bool {
|
|
return person.age > 18 ? true : true // Noncompliant; is this what was intended?
|
|
}
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
func canVote(person:Person) -> Bool {
|
|
return person.age > 18 ? true : false
|
|
}
|
|
----
|