Serhiy Storchaka added the comment:

Alternative implementations of _count_righthand_zero_bits():

def _count_righthand_zero_bits(number, bits):
    if not number:
        return bits
    return (~number & (number-1)).bit_length()

or

def _count_righthand_zero_bits(number, bits):
    if not number:
        return bits
    return (~(number | -number)).bit_length()

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21487>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to