diff options
Diffstat (limited to 'pack-revindex.c')
-rw-r--r-- | pack-revindex.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/pack-revindex.c b/pack-revindex.c index 96d51c3467..1b7ebd8d7e 100644 --- a/pack-revindex.c +++ b/pack-revindex.c @@ -59,7 +59,6 @@ static void sort_revindex(struct revindex_entry *entries, unsigned n, off_t max) * be a no-op, as everybody lands in the same zero-th bucket. */ for (bits = 0; max >> bits; bits += DIGIT_SIZE) { - struct revindex_entry *swap; unsigned i; memset(pos, 0, BUCKETS * sizeof(*pos)); @@ -97,9 +96,7 @@ static void sort_revindex(struct revindex_entry *entries, unsigned n, off_t max) * Now "to" contains the most sorted list, so we swap "from" and * "to" for the next iteration. */ - swap = from; - from = to; - to = swap; + SWAP(from, to); } /* @@ -107,7 +104,7 @@ static void sort_revindex(struct revindex_entry *entries, unsigned n, off_t max) * we have to move it back from the temporary storage. */ if (from != entries) - memcpy(entries, tmp, n * sizeof(*entries)); + COPY_ARRAY(entries, tmp, n); free(tmp); free(pos); |