The sample use of FileEnumerator, 
base::FileEnumerator enum(my_dir, false, base::FileEnumerator::FILES,
                            FILE_PATH_LITERAL("*.txt"));
for (base::FilePath name = enum.Next(); !name.empty(); name = enum.Next())
...

If we both take the priority of 'default start files' and cost of traversing files into consideration, I will put the priority array traverse as the inner cycle and files traversing outside, but no break in loop anymore.