Avoid readdir()ing if the list of possible matches can be found from patterns.
Avoid readdir()ing if the list of possible matches can be found from patterns.

--HG--
branch : HEAD

jkerihuel/dovecot,jkerihuel/dovecot,jkerihuel/dovecot,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jkerihuel/dovecot,jwm/dovecot-notmuch,jkerihuel/dovecot