aboutsummaryrefslogtreecommitdiff
path: root/archival/libarchive
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-02-03 19:11:00 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-02-03 19:11:00 +0100
commit10f516500ec8bbf2a9fb2ac53f88ba89f7472c17 (patch)
treef3ee62782c32d5e8ff52b363c255c3a54774cb71 /archival/libarchive
parent0599a137ba5a6043ce6195a2c12deeaf3886f002 (diff)
downloadbusybox-10f516500ec8bbf2a9fb2ac53f88ba89f7472c17.tar.gz
gzip2: small simplification in mainSimpleSort()
function old new delta mainQSort3 1165 1163 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/libarchive')
-rw-r--r--archival/libarchive/bz/blocksort.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/archival/libarchive/bz/blocksort.c b/archival/libarchive/bz/blocksort.c
index a1ee59224..578f6d41f 100644
--- a/archival/libarchive/bz/blocksort.c
+++ b/archival/libarchive/bz/blocksort.c
@@ -468,15 +468,16 @@ void mainSimpleSort(uint32_t* ptr,
int32_t d,
int32_t* budget)
{
- int32_t bigN;
- int hp;
-
- bigN = hi - lo + 1;
- if (bigN < 2) return;
-
- hp = 0;
- while (incs[hp] < bigN) hp++;
- hp--;
+ /* At which increment to start? */
+ int hp = 0;
+ {
+ int bigN = hi - lo;
+ if (bigN <= 0)
+ return;
+ while (incs[hp] <= bigN)
+ hp++;
+ hp--;
+ }
for (; hp >= 0; hp--) {
int32_t i;
@@ -754,22 +755,22 @@ void mainSort(EState* state,
#if CONFIG_BZIP2_FAST >= 2
for (; i >= 3; i -= 4) {
quadrant[i] = 0;
- j = (j >> 8) | (((uint16_t)block[i]) << 8);
+ j = (j >> 8) | (((unsigned)block[i]) << 8);
ftab[j]++;
quadrant[i-1] = 0;
- j = (j >> 8) | (((uint16_t)block[i-1]) << 8);
+ j = (j >> 8) | (((unsigned)block[i-1]) << 8);
ftab[j]++;
quadrant[i-2] = 0;
- j = (j >> 8) | (((uint16_t)block[i-2]) << 8);
+ j = (j >> 8) | (((unsigned)block[i-2]) << 8);
ftab[j]++;
quadrant[i-3] = 0;
- j = (j >> 8) | (((uint16_t)block[i-3]) << 8);
+ j = (j >> 8) | (((unsigned)block[i-3]) << 8);
ftab[j]++;
}
#endif
for (; i >= 0; i--) {
quadrant[i] = 0;
- j = (j >> 8) | (((uint16_t)block[i]) << 8);
+ j = (j >> 8) | (((unsigned)block[i]) << 8);
ftab[j]++;
}