This time, let’s consider the following routine used to determine if two strings are equal (case insensitively).  The code’s written in C# if it’s not obvious.

            static bool CompareStrings(String string1, String string2)
            {
                  //
                  //    Quick check to see if the strings length is different.  If the length is different, they are different.
                  //
                  if (string1.Length != string2.Length)
                  {
                        return false;
                  }

                  //
                  //    Since we're going to be doing a case insensitive comparison, let's upper case the strings.
                  //
                  string upperString1 = string1.ToUpper();
                  string upperString2 = string2.ToUpper();
                  //
                  //    And now walk through the strings comparing the characters to see if they match.
                  //
                  for (int i = 0 ; i < string1.Length ; i += 1)
                  {
                        if (upperString1[i] != upperString2[i])
                        {
                              return false;
                        }
                  }
                  return true;
            }

Yes, the code is less efficient than it could be, but there’s a far more fundamental issue with the code.  Your challenge is to determine what is incorrect about the code.

Answers (and of course kudos to those who found the issues) tomorrow.