[patch] strip kwalletbackend md5 handling
Michael Leupold
lemma at confuego.org
Fri Jun 13 23:50:03 BST 2008
Hi,
the kwallet format uses md5 hashing for all of the wallet's keys. This was
probably included to support loading data from the wallet file dynamically
but never really used. However it is used to generate md5 hashes for newly
inserted keys at runtime and insert them into a QList. This list is partly
used to verify a key exists.
In my opinion this inefficient for 2 reasons:
- MD5 hashing takes time (albeit little)
- searching an MD5 hash in a QList is a lot slower than just using a QHash
(instead of a QMap) to store all of the keys/passwords which are in memory
anyways.
Good things about removing it:
- faster
- less clutter
Drawbacks to the solution I propose:
- "When iterating over a QHash, the items are arbitrarily ordered. With QMap,
the items are always sorted by key.", so retrieving a list of entries from a
wallet would sport a different order on changing from QMap to QHash. However,
as the ordering of the entries wasn't guaranteed in the first place I doubt
any application is depending on that.
What do you think?
Regards,
Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-kwallet-md5hashes.diff
Type: text/x-diff
Size: 6716 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080614/11423126/attachment.diff>
More information about the kde-core-devel
mailing list