[Kde-pim] mixedmaildir optimization suggestion

David Faure faure at kde.org
Wed Sep 19 22:29:25 BST 2012


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();
?

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5

_______________________________________________
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