Skip to content

Commit b3925a7

Browse files
kbowers-jumpReisen
authored andcommitted
Minor ops tweak
1 parent b723c0f commit b3925a7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

program/src/oracle/sort/tmpl/sort_stable.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,10 @@ SORT_IMPL(stable_node)( SORT_KEY_T * x,
202202
}
203203
# endif
204204

205-
/* Append any stragglers (exactly one of these loops will execute) */
205+
/* Append any stragglers */
206206

207-
while( j<nl ) x[i++] = yl[j++];
208-
while( k<nr ) x[i++] = yr[k++];
207+
if( j<nl ) do x[i++] = yl[j++]; while( j<nl );
208+
else do x[i++] = yr[k++]; while( k<nr );
209209

210210
return x;
211211
}

0 commit comments

Comments
 (0)