diff options
author | Bobby Bingham <koorogi@koorogi.info> | 2014-07-31 21:55:25 -0500 |
---|---|---|
committer | Bobby Bingham <koorogi@koorogi.info> | 2014-07-31 21:55:25 -0500 |
commit | 7e8f512b93718083a6cb58527b0b51f4f70bc353 (patch) | |
tree | 4e8063aaf52aa96952b389a2fcffa3582b1bc37c | |
parent | a542b5d638db3b1cceeaeb08a07bab541ec7785f (diff) |
Reformat
-rw-r--r-- | grailsort.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/grailsort.c b/grailsort.c index 8d69b97..379e23a 100644 --- a/grailsort.c +++ b/grailsort.c @@ -25,16 +25,9 @@ size_t merge(char *buf, char *base, size_t anmel, size_t bnmel, size_t width, cm swap(base, a, anmel * width); - while (anmel > 0 && bnmel > 0) { - if (cmp(a, b) <= 0) { - swap(base, a, width); - a += width; - anmel--; - } else { - swap(base, b, width); - b += width; - bnmel--; - } + while (anmel && bnmel) { + if (cmp(a, b) <= 0) { swap(base, a, width); a += width; anmel--; } + else { swap(base, b, width); b += width; bnmel--; } base += width; } |