KDE/kdevplatform/shell

Hugo Parente Lima hugo.pl at gmail.com
Wed Aug 5 16:42:44 UTC 2009


On Wednesday 05 August 2009 09:44:04 Friedrich W. H. Kossebau wrote:
> Mercredi, le 5 août 2009, à 12:45, Andreas Pakulat a écrit:
> > On 05.08.09 02:15:08, Friedrich W. H. Kossebau wrote:
> > > SVN commit 1007055 by kossebau:
> > >
> > > changed: only need a QHash, not a QMap, for the KPart->QWidget storage
> >
> > Whats the advantage of using QHash instead of QMap here?
>
> From http://doc.trolltech.com/4.5/qhash.html#details :
> * QHash provides faster lookups than QMap
>
> And IIRC a QHash needs less memory than a QMap, but that is not guaranteed.

No, QHash uses much more memory than QMap, QMap is a tree (usually a Reb-black 
tree), QHash is a hash table. But QHash is much faster than QMap, specially 
for larger collections.

So QHash is not lighter than a QMap, just faster.

>
> So: QHash is lighter than a QMap, the extra properties of a QMap are not
> needed here.
>
> Cheers
> Friedrich
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20090805/02e9d0b2/attachment.sig>


More information about the KDevelop-devel mailing list