On Fri, 2024-01-19 at 13:38 -0800, Jeff Davis wrote: > One post-commit question on 0aba255440: why do > haszero64(pg_bswap64(chunk)) rather than just haszero64(chunk)? How > does byteswapping affect whether a zero byte exists or not?
I missed that it was used later when finding the rightmost one position. The placement of the comment was slightly confusing. Is: haszero64(pg_bswap64(chunk)) == pg_bswap64(haszero64(chunk)) ? If so, perhaps we can do the byte swapping outside of the loop, which might save a few cycles on longer strings and would be more readable. Regards, Jeff Davis