2020-12-21 15:38:52 +01:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,csharp]
|
2020-12-21 15:38:52 +01:00
|
|
|
----
|
|
|
|
public void Method()
|
|
|
|
{
|
|
|
|
var zero_length = new int[0]; // Noncompliant
|
|
|
|
var empty_array = new string[] { }; // Noncompliant
|
|
|
|
}
|
|
|
|
----
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,csharp]
|
2020-12-21 15:38:52 +01:00
|
|
|
----
|
|
|
|
public void Method()
|
|
|
|
{
|
|
|
|
var zero_length = Array.Empty<int>();
|
|
|
|
var empty_array = Array.Empty<string>();
|
|
|
|
}
|
|
|
|
----
|
|
|
|
|
|
|
|
include::../see.adoc[]
|
2021-09-20 15:38:42 +02:00
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
|
|
|
|
'''
|
|
|
|
== Implementation Specification
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../message.adoc[]
|
|
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|