In C#, when using List<T>, is it good to cache the Count property, or is the property fast enough?
<p>In other words, which of the following would be faster, if any?</p>

<pre><code>List&lt;MyClass&gt; myList;
...
...
foreach (Whatever whatever in SomeOtherLongList)
{
  ...
  if (i &lt; myList.Count)
  {
    ...
  }
}
</code></pre>

<p>or</p>

<pre><code>List&lt;MyClass&gt; myList;
...
...
int listCount = myList.Count;
foreach (Whatever whatever in SomeOtherLongList)
{
  ...
  if (i &lt; listCount)
  {
    ...
  }
}
</code></pre>

<p>Thanks :)</p>
