improve performance of setFromCross