title: Performance - before using a foreach loop check if the list is empty
body: <p>when using a foreach loop in Unity I need to call this in the update method. So it's called once per frame...</p>
  
  <p>I want to know, if it is better to check the count of the list before using the foreach loop or if it is redundant.</p>
  
  <p>So I have</p>
  
  <pre><code>if (myList.Count &gt; 0)
  {
      foreach (Type type in myList)
      {
      }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>foreach (Type type in myList) // no need for a check before
  {
  }
  </code></pre>
  
  <p>I could also use</p>
  
  <pre><code>for (int i = 0; i &lt; myList.Count; i++) // use a for loop instead
  {
      myList[i].DoSomething();
  }
  </code></pre>