Replace recursion in FilteredDirIterator with loop iteration
ClosedPublic

Authored by bruns on Oct 8 2019, 2:14 PM.

Details

Summary

In case many consecutive files are skipped in a directory, the
recursive next() implementation recursed for every file, i.e.
calling itself repeatedly.

Instead, loop over all directory items until either a file or directory
is found which should be indexed, or there are no more items left.

Move the "shouldIndexHidden" variable out of the loop, as it is
invariant.

Test Plan

ctest -R filtereddiriterator

Diff Detail

Repository
R293 Baloo
Branch
iterative_filtereddiriterator
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 17448
Build 17466: arc lint + arc unit
bruns created this revision.Oct 8 2019, 2:14 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptOct 8 2019, 2:14 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Oct 8 2019, 2:14 PM
ngraham accepted this revision.Oct 9 2019, 3:25 PM

This makes sense to me.

This revision is now accepted and ready to land.Oct 9 2019, 3:25 PM
This revision was automatically updated to reflect the committed changes.