unlzma: save a few more bytes, and maybe even a bit faster now
authorDenis Vlasenko <vda.linux@googlemail.com>
Sun, 2 Mar 2008 18:56:23 +0000 (18:56 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Sun, 2 Mar 2008 18:56:23 +0000 (18:56 -0000)
archival/libunarchive/decompress_unlzma.c

index 5bf4de2bdeea61ee6efd3195c3399700788c444b..aea0c8d942302916088d48a51a234eefc17ea68f 100644 (file)
@@ -306,13 +306,9 @@ unpack_lzma_stream(int src_fd, int dst_fd)
                                        match_byte <<= 1;
                                        bit = match_byte & 0x100;
                                        prob_lit = prob + 0x100 + bit + mi;
-                                       if (rc_get_bit(rc, prob_lit, &mi)) {
-                                               if (!bit)
-                                                       break;
-                                       } else {
-                                               if (bit)
-                                                       break;
-                                       }
+                                       bit ^= (rc_get_bit(rc, prob_lit, &mi) << 8); /* 0x100 or 0 */
+                                       if (bit)
+                                               break;
                                } while (mi < 0x100);
                        }
                        while (mi < 0x100) {