doctor: use Formula.installed directly

Before
```
brew doctor  9.83s user 0.52s system 76% cpu 13.563 total
```

After
```
brew doctor  0.25s user 0.16s system 9% cpu 4.332 total
```

Closes Homebrew/homebrew#40770.

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Xu Cheng 2015-06-16 14:58:47 +08:00
parent 1e86730289
commit 0e3c11ea07

View File

@ -927,8 +927,8 @@ end
def check_for_linked_keg_only_brews
return unless HOMEBREW_CELLAR.exist?
linked = Formula.select { |f|
f.keg_only? && f.installed? && __check_linked_brew(f)
linked = Formula.installed.select { |f|
f.keg_only? && __check_linked_brew(f)
}
unless linked.empty?