Create 2 variants of SortReorderByRow.

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

Change-Id: I2b18e2b8a9770fd9499dd9fc0d26397e67c1e8ae
(cherry picked from commit 13d64505214c33555dfbd61dbd9a177906df4981)