From kde-core-devel Tue Feb 27 19:35:49 2001 From: Stephan Kulow Date: Tue, 27 Feb 2001 19:35:49 +0000 To: kde-core-devel Subject: Re: faster kconfig X-MARC-Message: https://marc.info/?l=kde-core-devel&m=98330277405437 aleXXX wrote: > > On Tuesday 27 February 2001 12:17, Harri Porten wrote: > > aleXXX wrote: > > > Hi, > > > > > > I tried the following in kconfigdata.h but it didn't work correctly, > > > suddenly no icons where loaded anymore, I don't know why. I recompiled > > > only libkdecore. The two added lines would save again some thousands > > > qstrcmps() on startup for the most simply KDE 2 app and keep a unambigous > > > order for the used QMap. Maybe it would have been enough to recompile > > > some other stuff too, I don't know. > > > > > > inline bool operator <(const KEntryKey &k1, const KEntryKey &k2) > > > { > > > + if (k1.mGroup.size()!=k2.mGroup.size()) > > > + return (k1.mGroup.size() > > > > > register int result=qstrcmp(k1.mGroup.data(),k2.mGroup.data()); > > > > It might save you strcmp() calls but have you measured how much the > > resulting code is actually faster ? After all the QCString::size() calls > > will have to iterate through every character as well. A regular strcmp() > > implementation should abort on the first mismatched character, shouldn't > > it ? > > > > Harri. > > I think I had a look at the code and size() simply returns an int, without > iterating. It would have suprised me if size really called strlen or something. AFAIK QCString is QArray and this should have a fixed size Greetings, Stephan -- People in cars cause accidents. Accidents in cars cause people.