[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-optimize
Subject: Re: [tested PATCH] let QString::lower() assume lower case input to
From: Harri Porten <porten () trolltech ! com>
Date: 2003-01-24 18:42:11
[Download RAW message or body]
On Fri, 24 Jan 2003, Harri Porten wrote:
> > 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 :)
I found an elegant solution done by a colleague to be present in the main
(e.g. HEAD) branch already. Just applied my change that removes the imo
redundant if(p) check:
QString QString::lower() const
{
int l = length();
if ( l ) {
register QChar *p = d->unicode;
while ( l ) {
if ( *p != ::lower(*p) ) {
QString s( *this );
s.real_detach();
p = s.d->unicode + ( p - d->unicode );
while ( l ) {
*p = ::lower( *p );
l--;
p++;
}
return s;
}
l--;
p++;
}
}
return *this;
}
Harri.
_______________________________________________
Kde-optimize mailing list
Kde-optimize@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-optimize
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic