More general optimisation for obvious subpaths