def to_7bit(x, islong):
    if not islong:
        shift = 31
        nchars = 5
    else:
        shift = 62
        nchars = 10
    
    buffer = array("c", "\x00" * nchars)
    x += 1-(1<<shift)
    while x:
        buffer[nchars-1] = chr(x & 0x7f)
        x >>= 7
        nchars -= 1
        return buffer.tostring()
dataset/ETHPy150Open dokipen/whoosh/src/whoosh/util.py/to_7bit/swapped operands of `-`