title: Performance of enum conversion
body: <p>after a bit speedtracing I found a piece of code (called very very often) which converts values of one enum to values of another enum, like this:</p>
  
  <pre><code>public Enum2 ConvertToEnum2(Enum1 enum1)
  {
     switch(enum1)
     {
        case Enum1.One:
           return Enum2.One;
           break;
        case Enum1.Two:
           return Enum2.Two;
           break;
     }
  }
  </code></pre>
  
  <p>Would it me more performant if I save those conversions in a Dictionary and just do something like this:</p>
  
  <pre><code>public Enum2 ConvertToEnum2(Enum1 enum1)
  {
     return m_ConversionTable[enum1];
  }
  </code></pre>
  
  <p>Thanks for your comments!</p>