32 lines
481 B
Plaintext
32 lines
481 B
Plaintext
include::../description.adoc[]
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
if(collection.Count >= 0){...}
|
|
|
|
if(enumerable.Count() < 0){...}
|
|
|
|
if(array.Length >= 0){...}
|
|
|
|
bool result = array.Length >=0;
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
if (list.Any()) { ... }
|
|
|
|
if (list.Count > 0) { ... }
|
|
|
|
if (array.Length >= 42) { ... }
|
|
----
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|