换言之,如果是的话,以下几个方面会更快?
List<MyClass> myList;
...
...
f或each (Whatever whatever in SomeOtherLongList)
{
...
if (i < myList.Count)
{
...
}
}
或
List<MyClass> myList;
...
...
int listCount = myList.Count;
f或each (Whatever whatever in SomeOtherLongList)
{
...
if (i < listCount)
{
...
}
}
感谢: