[git commit] bzip2: small simplification in mainSort()

Denys Vlasenko vda.linux at googlemail.com
Sat Feb 3 17:11:08 UTC 2018


commit: https://git.busybox.net/busybox/commit/?id=9431bdd189859e3053bcb268116d6459964ebe60
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

function                                             old     new   delta
mainSort                                            1127    1118      -9

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 archival/libarchive/bz/blocksort.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/archival/libarchive/bz/blocksort.c b/archival/libarchive/bz/blocksort.c
index fe2b2c2f2..2e08f2f9d 100644
--- a/archival/libarchive/bz/blocksort.c
+++ b/archival/libarchive/bz/blocksort.c
@@ -833,13 +833,13 @@ void mainSort(EState* state,
 			/*h = h / 3;*/
 			h = (h * 171) >> 9; /* bbox: fast h/3 */
 			for (i = h; i <= 255; i++) {
-				unsigned vv;
+				unsigned vv, jh;
 				vv = runningOrder[i]; /* uint8[] */
 				j = i;
-				while (BIGFREQ(runningOrder[j-h]) > BIGFREQ(vv)) {
-					runningOrder[j] = runningOrder[j-h];
-					j = j - h;
-					if (j <= (h - 1))
+				while (jh = j - h, BIGFREQ(runningOrder[jh]) > BIGFREQ(vv)) {
+					runningOrder[j] = runningOrder[jh];
+					j = jh;
+					if (j < h)
 						break;
 				}
 				runningOrder[j] = vv;


More information about the busybox-cvs mailing list