minor optimisation, refs comments on 81875cfeb1b8e5c414cf9de3c96dd2dde50150bc
Merge pull request #3878 from ceeram/optimize

minor optimisation, refs comments on 81875cfeb1b8e5c414cf9de3c96dd2dde50...