[Development] qHash / QHash changes
Thiago Macieira
thiago.macieira at intel.com
Mon Mar 19 11:24:37 CET 2012
On segunda-feira, 19 de março de 2012 11.17.29, André Somers wrote:
> Op 19-3-2012 10:42, Thiago Macieira schreef:
> > They shouldn't rely on that at all. The documentation of QHash says
> > that it produces an arbitrary but stable[1] order.
> >
> > [1] note that the order is stable. Two hashing tables with the same
> > elements must produce the same order.
>
> If I understood Giuseppe correctly, the meaning of 'stable' will be
> limited to those hashes that have been initialized with the same seed,
> which by default is the case for hashes within the same process, but not
> for hashes created in different processes or in different runs of the
> application.
Oh.
I'm not sure we want that then. It might be a security feature, but it's WAY
too late to add that to Qt 5.
It breaks the property of comparing QHashes item by item. That's probably the
property I relied on in the QtDBus unit tests in question.
The seed could be calculated once per process, instead.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
Intel Sweden AB - Registration Number: 556189-6027
Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120319/0f08bb1f/attachment.sig>
More information about the Development
mailing list