aboutsummaryrefslogtreecommitdiff
path: root/spill.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <[email protected]>2021-03-02 10:01:26 +0100
committerQuentin Carbonneaux <[email protected]>2021-03-02 10:01:26 +0100
commit99c8f84efc280265d026737b2bdfd4741c8a74e8 (patch)
tree5fe0b0d0d3b5ada0e52d666c96443725572363d4 /spill.c
parent4e81cc2f8a28ba168b446dbbd24a3877e6837da9 (diff)
fix a couple asan complaints
Diffstat (limited to 'spill.c')
-rw-r--r--spill.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/spill.c b/spill.c
index c1599c0..1aab8e5 100644
--- a/spill.c
+++ b/spill.c
@@ -173,11 +173,13 @@ limit(BSet *b, int k, BSet *f)
bsclr(b, t);
tarr[i++] = t;
}
- if (!f)
- qsort(tarr, nt, sizeof tarr[0], tcmp0);
- else {
- fst = f;
- qsort(tarr, nt, sizeof tarr[0], tcmp1);
+ if (nt > 1) {
+ if (!f)
+ qsort(tarr, nt, sizeof tarr[0], tcmp0);
+ else {
+ fst = f;
+ qsort(tarr, nt, sizeof tarr[0], tcmp1);
+ }
}
for (i=0; i<k && i<nt; i++)
bsset(b, tarr[i]);