Homebrew/homebrew — pull request #27295 by jaimeMF (2014-03-07 16:00:06+00:00)
Title: uses: Fix `--installed` with outdated versions (fixes #27259)

With that option iterate only over `Formula.installed`, otherwise iterate over `Formula`.
This is faster than iterating over all the formulae and checking if it's installed.