Compare( const basic_nsAReadableString<CharT>& lhs, const basic_nsAReadableString<CharT>& rhs )
basic_nsAReadableString<CharT>::Compare( const basic_nsAReadableString<CharT>& rhs ) const
Compare( const basic_nsAReadableString<CharT>& lhs, const basic_nsAReadableString<CharT>& rhs )  {    if ( &lhs == &rhs )      return 0;    PRUint32 lLength = lhs.Length();    PRUint32 rLength = rhs.Length();    PRUint32 lengthToCompare = NS_MIN(lLength, rLength);    nsReadingIterator<CharT> leftIter, rightIter;    lhs.BeginReading(leftIter);    rhs.BeginReading(rightIter);    int result;    for (;;)      {        PRUint32 lengthAvailable = PRUint32( NS_MIN(leftIter.size_forward(), rightIter.size_forward()) );        if ( lengthAvailable > lengthToCompare )          lengthAvailable = lengthToCompare;          // Note: |result| should be declared in this |if| expression, but some compilers don't like that        if ( (result = nsCharTraits<CharT>::compare(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;  }