Micro optimize Node contains

The old code was doing too much work