All pastes #254803 Raw Edit

Mine

public text v1 · immutable
#254803 ·published 2006-11-22 09:09 UTC
rendered paste body
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
private static unsafe bool EqualsHelper(string strA, string strB)
{
      int num1 = strA.Length;
      if (num1 != strB.Length)
      {
            return false;
      }
      fixed (char* text1 = ((char*) strA))
      {
            char* chPtr1 = text1;
            fixed (char* text2 = ((char*) strB))
            {
                  char* chPtr2 = text2;
                  char* chPtr3 = chPtr1;
                  char* chPtr4 = chPtr2;
                  while (num1 >= 10)
                  {
                        if ((((*(((int*) chPtr3)) != *(((int*) chPtr4))) || (*(((int*) (chPtr3 + 2))) != *(((int*) (chPtr4 + 2))))) || ((*(((int*) (chPtr3 + 4))) != *(((int*) (chPtr4 + 4)))) || (*(((int*) (chPtr3 + 6))) != *(((int*) (chPtr4 + 6)))))) || (*(((int*) (chPtr3 + 8))) != *(((int*) (chPtr4 + 8)))))
                        {
                              break;
                        }
                        chPtr3 += 10;
                        chPtr4 += 10;
                        num1 -= 10;
                  }
                  while (num1 > 0)
                  {
                        if (*(((int*) chPtr3)) != *(((int*) chPtr4)))
                        {
                              break;
                        }
                        chPtr3 += 2;
                        chPtr4 += 2;
                        num1 -= 2;
                  }
                  return (num1 <= 0);
            }
      }
}