speedup searching for space

It's ugly but faster by 1%-2%

Numbers from empty clang builds:

- std::find()
$ measure.py 200 ninja
sampling: ...
best: 164ms
mean: 173ms +- 8.7ms


- ContainsSpace()
$ measure.py 200 ninja
sampling: ...
best: 161ms
mean: 169ms +- 6.0ms