[Kde-pim] mixedmaildir optimization suggestion
Kevin Krammer
krammer at kde.org
Sat Oct 13 09:12:59 BST 2012
On Wednesday, 2012-09-19, David Faure wrote:
> From mixedmaildirstore.cpp:
> 370│
> 371│ bool isValidEntry( const QString &entry ) const {
> 372├> return mMaildir.entryList().contains( entry );
> 373│ }
>
> Why list a very very big directory, just to find out if ONE file exists?
> [entryList() is slow because it uses QDir::entryList(), which sorts by
> name, case insensitively.... lots of toLower() calls and lots of sorting].
>
>
> Shouldn't this be
> return !mMaildir.findRealKey(entry).isEmpty();
> ?
Yes, that should be OK. Please commit to whatever branches you find this useful
for :)
Cheers,
Kevin
--
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- 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://mail.kde.org/pipermail/kde-pim/attachments/20121013/67f78afe/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list