Compare( const nsACString& lhs, const nsACString& rhs, const nsCStringComparator& aComparator )
Compare( const nsAString& lhs, const nsAString& rhs, const nsStringComparator& aComparator )
Compare( const nsACString& lhs, const nsACString& rhs, const nsCStringComparator& aComparator )  {    typedef nsACString::size_type   size_type;    if ( &lhs == &rhs )      return 0;    size_type lLength = lhs.Length();    size_type rLength = rhs.Length();    size_type lengthToCompare = NS_MIN(lLength, rLength);    nsACString::const_iterator leftIter, rightIter;    lhs.BeginReading(leftIter);    rhs.BeginReading(rightIter);    for (;;)      {        size_type lengthAvailable = size_type( NS_MIN(leftIter.size_forward(), rightIter.size_forward()) );        if ( lengthAvailable > lengthToCompare )          lengthAvailable = lengthToCompare;        {          int result;            // Note: |result| should be declared in this |if| expression, but some compilers don't like that          if ( (result = aComparator(leftIter.get(), rightIter.get(), lengthAvailable)) != 0 )            return result;        }        if ( !(lengthToCompare -= lengthAvailable) )          break;        leftIter.advance( PRInt32(lengthAvailable) );        rightIter.advance( PRInt32(lengthAvailable) );      }    if ( lLength < rLength )      return -1;    else if ( rLength < lLength )      return 1;    else      return 0;  }