[UnindexedFileIterator] Delay mimetype determination until it is needed
ClosedPublic

Authored by bruns on Tue, Jun 4, 2:14 PM.

Details

Summary

The mimetype is only required if all the other checks pass, i.e. when
the file has been modified or added.

It is beneficial to swap the order of timestamp and mimetype checks, as
the mimetype determination is much more expensive than the timestamp
retrieval, and the mimetype filter will only reject files occasionally
while the mtime filter will reject files most of the times.

Skip the mimetype determination for directories which would return
wrong results anyway, either "application/octet-stream" or even
"text/plain" for a directory named "test.log".

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Tue, Jun 4, 2:14 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptTue, Jun 4, 2:14 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Tue, Jun 4, 2:14 PM
poboiko accepted this revision.Tue, Jun 4, 5:29 PM
This revision is now accepted and ready to land.Tue, Jun 4, 5:29 PM
ngraham accepted this revision.Tue, Jun 4, 5:37 PM

Makes perfect sense.

This revision was automatically updated to reflect the committed changes.