menu

manual-isolate-lowest-one

Prefer isolateLowestOne over its manual wrapping bitwise form

Combining an integer with its wrapping negation isolates its least-significant one bit. Instead, you SHOULD call .isolateLowestOne() on the integer.

Reported

1function lowest(value: uint32): uint32 {2    return value & value.wrappingNegate();3}

Accepted

1function lowest(value: uint32): uint32 {2    return value.isolateLowestOne();3}