mxcl/homebrew — pull request #16659 by mistydemeo (2012-12-19 22:37:42+00:00)
Title: utils: replace shell `which` with native code

I wrote this for tigerbrew to work around its terrible implementation of the `which` tool, but turned out to be useful enough I think it could be good for core. It replaces the shell out to `which` with the equivalent check in ruby, which apparently is faster according to ruby's benchmarks (based on running a single `which` which returns a result using Benchmark.measure):

```
shell which: 0.0033822
ruby which: 0.0000961
```

It makes an unmeasurably, statistically-insignificant speed difference when running the testsuite or brew doctor. Micro-optimizations!

Going to push this tonight probably, unless someone opposes it.