Create 2 variants of SortReorderByRow.

One for IsUpdateRefs() true, the other for IsUpdateRefs() false.

Change-Id: I2b18e2b8a9770fd9499dd9fc0d26397e67c1e8ae