Resuse computations to avoid setdiff