2021-04-28 16:49:39 +02:00
|
|
|
Array literals are more compact than array creation expressions.
|
|
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
|
|
|
|
----
|
|
|
|
Module Module1
|
|
|
|
Sub Main()
|
|
|
|
Dim foo = New String() {"a", "b", "c"} ' Noncompliant
|
|
|
|
End Sub
|
|
|
|
End Module
|
|
|
|
----
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
|
|
|
----
|
|
|
|
Module Module1
|
|
|
|
Sub Main()
|
|
|
|
Dim foo = {"a", "b", "c"} ' Compliant
|
|
|
|
End Sub
|
|
|
|
End Module
|
|
|
|
----
|