summaryrefslogtreecommitdiff
path: root/builtin/index-pack.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2016-09-29 23:40:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-30 03:40:23 (GMT)
commit1b5294de406146c4ec321a59e07a5566c435cc2e (patch)
tree979dc60014fac5535ee633cb5fdbcc1eb037a269 /builtin/index-pack.c
parenta9a884aea57b162a3257437b5cbdf8d8037b7c06 (diff)
downloadgit-1b5294de406146c4ec321a59e07a5566c435cc2e.zip
git-1b5294de406146c4ec321a59e07a5566c435cc2e.tar.gz
git-1b5294de406146c4ec321a59e07a5566c435cc2e.tar.bz2
use QSORT, part 2
Convert two more qsort(3) calls to QSORT to reduce code size and for better safety and consistency. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r--builtin/index-pack.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 7657d0a..0a27bab 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1531,8 +1531,7 @@ static void read_v2_anomalous_offsets(struct packed_git *p,
opts->anomaly[opts->anomaly_nr++] = ntohl(idx2[off * 2 + 1]);
}
- if (1 < opts->anomaly_nr)
- qsort(opts->anomaly, opts->anomaly_nr, sizeof(uint32_t), cmp_uint32);
+ QSORT(opts->anomaly, opts->anomaly_nr, cmp_uint32);
}
static void read_idx_option(struct pack_idx_option *opts, const char *pack_name)