[patch] KConfig: Efficient iterators

Matthias Kretz kretz at kde.org
Tue Apr 22 14:46:43 BST 2008


On Tuesday 22 April 2008, David Jarvie wrote:
> > Use KEntryMap::ConstIterator instead of foreach with entryMap.keys().
> >
> > Infinite loops may take just one second on your box too, _but_ better to
> > optimize them :)
>
> If foreach has such a bad impact on performance, I suggest adding comments
> about this into the code, just in case anybody in future is tempted to
> change the code back to foreach.

I'd expect the problem to be QMap::keys(), not foreach itself.

-- 
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080422/64c19111/attachment.sig>


More information about the kde-core-devel mailing list