문제

Is there any execution speed difference between the following two lines of code? I cannot tell from looking at the IL:

int x = MainObject.Field1;
int x = MainObject.Public.Fields.Field1;

I know from Delphi (native code), there is no difference.

도움이 되었습니까?

해결책

Accesing by '.' to deeper class structure elements - NO, but method invocation with it - YES.

다른 팁

There is no difference whatsoever. (assuming you mean, as you say in the title, fields)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top