FindInReadable_Impl( const basic_nsAReadableString<CharT>& aPattern,
FindInReadable_Impl( const typename nsStringTraits<CharT>::abstract_string_type& aPattern,
FindInReadable_Impl( const basic_nsAReadableString<CharT>& aPattern,                     nsReadingIterator<CharT>& aSearchStart,                     nsReadingIterator<CharT>& aSearchEnd )  {    PRBool found_it = PR_FALSE;      // only bother searching at all if we're given a non-empty range to search    if ( aSearchStart != aSearchEnd )      {        nsReadingIterator<CharT> aPatternStart, aPatternEnd;        aPattern.BeginReading(aPatternStart);        aPattern.EndReading(aPatternEnd);          // outer loop keeps searching till we find it or run out of string to search        while ( !found_it )          {              // fast inner loop (that's what it's called, not what it is) looks for a potential match            while ( aSearchStart != aSearchEnd && *aPatternStart != *aSearchStart )              ++aSearchStart;              // if we broke out of the `fast' loop because we're out of string ... we're done: no match            if ( aSearchStart == aSearchEnd )              break;              // otherwise, we're at a potential match, let's see if we really hit one            nsReadingIterator<CharT> testPattern(aPatternStart);            nsReadingIterator<CharT> testSearch(aSearchStart);              // slow inner loop verifies the potential match (found by the `fast' loop) at the current position            for(;;)              {                  // we already compared the first character in the outer loop,                  //  so we'll advance before the next comparison                ++testPattern;                ++testSearch;                  // if we verified all the way to the end of the pattern, then we found it!                if ( testPattern == aPatternEnd )                  {                    found_it = PR_TRUE;                    aSearchEnd = testSearch; // return the exact found range through the parameters                    break;                  }                  // if we got to end of the string we're searching before we hit the end of the                  //  pattern, we'll never find what we're looking for                if ( testSearch == aSearchEnd )                  {                    aSearchStart = aSearchEnd;                    break;                  }                  // else if we mismatched ... it's time to advance to the next search position                  //  and get back into the `fast' loop                if ( *testPattern != *testSearch )                  {                    ++aSearchStart;                    break;                  }              }          }      }    return found_it;  }