pisa-engine / pisa

PISA: Performant Indexes and Search for Academia
https://pisa-engine.github.io/pisa/book
Apache License 2.0
942 stars 65 forks source link

Fix log of zero #510

Closed elshize closed 1 year ago

elshize commented 1 year ago

Yeah, I don't think we were ever calling log2(0) but Codacy picked it up as a warning, and I can't be bothered to check in the standard if this is defined behavior (even though cppreference says it just should return -inf, but then again, it was wrong about the heap stuff before). So just to be on the safe side, I decided to fill this one myself, so we avoid any potential UB.