Make portal transit check more performant.