34 lines
697 B
Plaintext
34 lines
697 B
Plaintext
=== Code examples
|
|
|
|
==== Noncompliant code example
|
|
|
|
[source,vbnet,diff-id=1,diff-type=noncompliant]
|
|
----
|
|
Function GetMax(data As SortedSet(Of Integer)) As Integer
|
|
Return Enumerable.Max(data)
|
|
End Function
|
|
----
|
|
|
|
[source,vbnet,diff-id=2,diff-type=noncompliant]
|
|
----
|
|
Function GetMin(data As SortedSet(Of Integer)) As Integer
|
|
Return Enumerable.Min(data)
|
|
End Function
|
|
----
|
|
|
|
==== Compliant solution
|
|
|
|
[source,vbnet,diff-id=1,diff-type=compliant]
|
|
----
|
|
Function GetMax(data As SortedSet(Of Integer)) As Integer
|
|
Return data.Max()
|
|
End Function
|
|
----
|
|
|
|
[source,vbnet,diff-id=2,diff-type=compliant]
|
|
----
|
|
Function GetMin(data As SortedSet(Of Integer)) As Integer
|
|
Return data.Min()
|
|
End Function
|
|
----
|