[NRV] Optimized path matching