Small change to avoid an if gives approx 10% speedup