Web lists-archives.com

Re: Review Request 129349: [baloo] add (and use) FileIndexerConfig::shouldFileBeIndexed(const QStringRef&)




This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/129349/

+1


src/file/fileindexerconfig.h (Diff revision 1)
119
    bool shouldFileBeIndexed(const QStringRef &fileName) const;

You need to duplicate the API documentation.


src/file/fileindexerconfig.cpp (Diff revision 1)
bool FileIndexerConfig::shouldFileBeIndexed(const QString& fileName) const
188
    if (!indexHiddenFilesAndFolders() && fileName.startsWith('.')) {
188
    if (!indexHiddenFilesAndFolders() && fileName.startsWith('.')) {

Make this one call the QStringRef variant, not to duplicate code?


- Aleix Pol Gonzalez


On November 6th, 2016, 2:45 p.m. CET, Christian Ehrlicher wrote:

Review request for Baloo.
By Christian Ehrlicher.

Updated Nov. 6, 2016, 2:45 p.m.

Repository: baloo

Description

Use the new QStringRef class to avoid creation of temporary QString objects. Since every filename is sent through FileIndexerConfig::shouldFileBeIndexed(), I think this is a good optimization although now there are two functions for FileIndexerConfig::shouldFileBeIndexed() and RegExpCache::exactMatch() - one with QString and one with QStringRef ...

Diffs

  • src/engine/queryparser.cpp (d096bf3)
  • src/file/fileindexerconfig.h (10eacd5)
  • src/file/fileindexerconfig.cpp (0e4f4c4)
  • src/file/modifiedfileindexer.cpp (d1f5011)
  • src/file/newfileindexer.cpp (7e19622)
  • src/file/regexpcache.h (60d370d)
  • src/file/regexpcache.cpp (61f07d6)
  • src/file/xattrindexer.cpp (3daecef)
  • src/kioslaves/tags/kio_tags.cpp (de2e6d7)

View Diff