i.e., thpres->hasRegionBarrier(i, j) == thpres->hasRegionBarrier(j, i) this allows to simplify the code a bit.