G
Guest
from using FxCop and reading MSDN i understand that i should not use properties to access arrays, i should use methods instead,
however when i try the code below the MSIL for method and property access is identical, bar a slight differenc in code size and stack size.
What is the correct way to access an array, given that i need to perform actions on sections of the array as well as individual elements. Do I just access it directly? (in my actual app the array is 2 dimensional, approx 64k elements)
sample code:-
Private _a(100) As Integer
Public Property a() As Integer()
Get
Return _a
End Get
Set(ByVal Value() As Integer)
_a = Value
End Set
End Property
Public Function GetA() As Integer()
Return _a
End Function
Public Function SetA(ByVal x() As Integer) As Integer()
_a = x
End Function
however when i try the code below the MSIL for method and property access is identical, bar a slight differenc in code size and stack size.
What is the correct way to access an array, given that i need to perform actions on sections of the array as well as individual elements. Do I just access it directly? (in my actual app the array is 2 dimensional, approx 64k elements)
sample code:-
Private _a(100) As Integer
Public Property a() As Integer()
Get
Return _a
End Get
Set(ByVal Value() As Integer)
_a = Value
End Set
End Property
Public Function GetA() As Integer()
Return _a
End Function
Public Function SetA(ByVal x() As Integer) As Integer()
_a = x
End Function