Time Nick Message 10:11 MTDiscord sfan5: Have you considered the performance implications of https://github.com/minetest/irrlicht/commit/81bae5b717a79fc2b05a09f760afc7b44da98487 ? It looks like those "questionable" bit hacks were used to improve performance by getting rid of expensive branching. 10:13 MTDiscord improving performance by making it return wrong at times doesn't feel like a smart way of doing things 10:15 sfan5 yes and the result I arrived at is "the compiler should optimize it somehow" 10:16 sfan5 perhaps using a CMOV instructions or by applying a (this time correct) version of the bit hacks itself 11:02 MTDiscord Well, IIRC ternaries don't use branching, and simple if-return things might be optimized to ternaries. 11:32 pgimeno compilers know how to optimize return a < b ? a : b; and similar 11:32 pgimeno if the boolean operation is better, they will use that 13:30 pgimeno this proves that the compiler knows about it: https://godbolt.org/z/vo4Ma676x 13:31 pgimeno in x86-64, ARM etc. it uses conditional move (cmov / movlt)