== Why is this an issue?

Method for creating empty arrays ``++Array.Empty(Of TElement)++`` was introduced in .NET 4.6 to optimize object instantiation and memory allocation. It also improves code readability by making developer's intent more explicit. This new method should be preferred over empty array declaration.

=== Noncompliant code example

[source,vbnet]
----
Public Sub Method()
    Dim Values1(-1) As Integer ' Noncompliant
    Dim Values2 As Integer() = New Integer() {} ' Noncompliant
    Dim Values3 As Integer() = {} ' Noncompliant
    Dim Values4() As Integer = {} ' Noncompliant
End Sub
----

=== Compliant solution

[source,vbnet]
----
Public Sub Method()
    Dim Values1 As Integer() = Array.Empty(Of Integer)
    Dim Values2 As Integer() = Array.Empty(Of Integer)
    Dim Values3 As Integer() = Array.Empty(Of Integer)
    Dim Values4() As Integer = Array.Empty(Of Integer)
End Sub
----

include::../see.adoc[]

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

=== Message

Replace this empty array with Array.Empty(Of TElement).


endif::env-github,rspecator-view[]
