aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-02-03 16:43:33 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-02-03 16:43:33 +0100
commitaaa3818a75bb64bb96a1cda9412162aa7a8a44de (patch)
treeff17957de70d56d5376b437687799e7730425390
parente59e5ff96e9461dc658748509ec41408c140f6fb (diff)
downloadbusybox-w32-aaa3818a75bb64bb96a1cda9412162aa7a8a44de.tar.gz
busybox-w32-aaa3818a75bb64bb96a1cda9412162aa7a8a44de.tar.bz2
busybox-w32-aaa3818a75bb64bb96a1cda9412162aa7a8a44de.zip
bzip2: remove redundant loop termination check in mainSort()
function old new delta mainSort 1202 1192 -10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--archival/libarchive/bz/blocksort.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/archival/libarchive/bz/blocksort.c b/archival/libarchive/bz/blocksort.c
index 0b614ce08..19341369c 100644
--- a/archival/libarchive/bz/blocksort.c
+++ b/archival/libarchive/bz/blocksort.c
@@ -825,7 +825,6 @@ void mainSort(EState* state,
825 } 825 }
826 826
827 { 827 {
828 int32_t vv;
829 /* bbox: was: int32_t h = 1; */ 828 /* bbox: was: int32_t h = 1; */
830 /* do h = 3 * h + 1; while (h <= 256); */ 829 /* do h = 3 * h + 1; while (h <= 256); */
831 uint32_t h = 364; 830 uint32_t h = 364;
@@ -834,6 +833,7 @@ void mainSort(EState* state,
834 /*h = h / 3;*/ 833 /*h = h / 3;*/
835 h = (h * 171) >> 9; /* bbox: fast h/3 */ 834 h = (h * 171) >> 9; /* bbox: fast h/3 */
836 for (i = h; i <= 255; i++) { 835 for (i = h; i <= 255; i++) {
836 int32_t vv;
837 vv = runningOrder[i]; 837 vv = runningOrder[i];
838 j = i; 838 j = i;
839 while (BIGFREQ(runningOrder[j-h]) > BIGFREQ(vv)) { 839 while (BIGFREQ(runningOrder[j-h]) > BIGFREQ(vv)) {
@@ -854,7 +854,7 @@ void mainSort(EState* state,
854 854
855 numQSorted = 0; 855 numQSorted = 0;
856 856
857 for (i = 0; i <= 255; i++) { 857 for (i = 0; /*i <= 255*/; i++) {
858 858
859 /* 859 /*
860 * Process big buckets, starting with the least full. 860 * Process big buckets, starting with the least full.
@@ -974,7 +974,10 @@ void mainSort(EState* state,
974 */ 974 */
975 bigDone[ss] = True; 975 bigDone[ss] = True;
976 976
977 if (i < 255) { 977 if (i == 255)
978 break;
979
980 {
978 int32_t bbStart = ftab[ss << 8] & CLEARMASK; 981 int32_t bbStart = ftab[ss << 8] & CLEARMASK;
979 int32_t bbSize = (ftab[(ss+1) << 8] & CLEARMASK) - bbStart; 982 int32_t bbSize = (ftab[(ss+1) << 8] & CLEARMASK) - bbStart;
980 int32_t shifts = 0; 983 int32_t shifts = 0;