use local caches, avoid lookup, inline trivial comparison

Infinite speedup of Multi5x5BremRecoveryClusterAlgo
btw the code seems duplicated in BremRecoveryClusterAlgo in the same directory (not touched…)