[tested PATCH] let QString::lower() assume lower case input to avoid real_detach()

Harri Porten kde-optimize@mail.kde.org
Fri, 24 Jan 2003 17:26:13 +0100 (CET)


On Fri, 24 Jan 2003, Lubos Lunak wrote:

> > Summary: Not worth it for upper, definitely worth it for lower.
> > (You have to create that a temporary QString object anyway since
> >  lower() is const, but this avoids creating a new QStringData,
> >  and copying the strings themselves...)
> 
>  If it's tested patch, you could probably send it to qt-bugs@trolltech.com :).

No need to. I will fix* and improve it a bit and check it into qt-copy for
everyone to tes^H^H^Henjoy :)

Harri.

* I assume that you wanted a ++ somewhere in here ;)

+          do {
+	      c_any = *p;
+	      c_wanted = ::lower( c_any );
+	    }
+	    while (c_any == c_wanted && --l);