def next_smaller(self):
        int_seg = int(self.seg, 16)
        assert int_seg <= 0xFF

        if int_seg == 0:
            # Seg is at the minimum value, carry the decrement from
            # 'log'.
            int_log = int(self.log, 16)
            assert 0xFFFFFFFF <= int_log

            # 0 is a valid int_log, but not when decrementing from a
            # 0-valued segment: negative such values are not valid.
            assert int_seg == 0 and int_log > 0

            # NB: older versions of Postgres won't generate a seg
            # value of 0xFF, so a gap has to be treated
            # conservatively.
            s_log = SegmentNumber._integer_to_name(int_log - 1)
            s_seg = SegmentNumber._integer_to_name(0xFF)

            return self.__class__(log=s_log, seg=s_seg)
        else:
            assert int_seg > 0

            s_log = self.log
            s_seg = SegmentNumber._integer_to_name(int_seg - 1)

            return self.__class__(log=s_log, seg=s_seg)

        assert False
dataset/ETHPy150Open wal-e/wal-e/wal_e/storage/base.py/SegmentNumber.next_smaller/swapped operands of `<=`