rspec/rules/S3898/vbnet/rule.adoc
Fred Tingaud 51369b610e
Make sure that includes are always surrounded by empty lines (#2270)
When an include is not surrounded by empty lines, its content is inlined
on the same line as the adjacent content. That can lead to broken tags
and other display issues.
This PR fixes all such includes and introduces a validation step that
forbids introducing the same problem again.
2023-06-22 10:38:01 +02:00

35 lines
794 B
Plaintext

== Why is this an issue?
If you're using a `Structure`, it is likely because you're interested in performance. But by failing to implement `IEquatable<T>` you're loosing performance when comparisons are made because without `IEquatable<T>`, boxing and reflection are used to make comparisons.
=== Noncompliant code example
[source,vbnet]
----
Structure MyStruct ' Noncompliant
Public Property Value As Integer
End Structure
----
=== Compliant solution
[source,vbnet]
----
Structure MyStruct
Implements IEquatable(Of MyStruct)
Public Property Value As Integer
Public Overloads Function Equals(other As MyStruct) As Boolean Implements IEquatable(Of MyStruct).Equals
' ...
End Function
End Structure
----
include::../see.adoc[]
include::../rspecator.adoc[]