]> git.pld-linux.org Git - packages/qt.git/blob - qt-tiny-qstring-speedup.patch
- desc why patches are commented out
[packages/qt.git] / qt-tiny-qstring-speedup.patch
1 --- qt-copy/src/tools/qstring.cpp.orig  2 Mar 2004 12:50:34 -0000       1.63
2 +++ qt-copy/src/tools/qstring.cpp       26 Mar 2004 20:40:06 -0000
3 @@ -6731,14 +6731,11 @@ bool QString::startsWith( const QString&
4      if ( isNull() )
5         return s.isNull();
6      if ( s.length() > length() )
7         return FALSE;
8      if ( cs ) {
9 -       for ( int i = 0; i < (int) s.length(); i++ ) {
10 -           if ( d->unicode[i] != s[i] )
11 -               return FALSE;
12 -       }
13 +        return memcmp((char*)d->unicode,(char*)s.unicode(), s.length()*sizeof(QChar)) == 0;
14      } else {
15         for ( int i = 0; i < (int) s.length(); i++ ) {
16             if ( d->unicode[i].lower() != s[i].lower() )
17                 return FALSE;
18         }
19 @@ -6772,14 +6769,11 @@ bool QString::endsWith( const QString& s
20         return s.isNull();
21      int pos = length() - s.length();
22      if ( pos < 0 )
23         return FALSE;
24      if ( cs ) {
25 -       for ( int i = 0; i < (int) s.length(); i++ ) {
26 -           if ( d->unicode[pos + i] != s[i] )
27 -               return FALSE;
28 -       }
29 +        return memcmp((char*)&d->unicode[pos],(char*)s.unicode(), s.length()*sizeof(QChar)) == 0;
30      } else {
31         for ( int i = 0; i < (int) s.length(); i++ ) {
32             if ( d->unicode[pos + i].lower() != s[i].lower() )
33                 return FALSE;
34         }
This page took 0.084371 seconds and 3 git commands to generate.