On Wed, Aug 16, 2017 at 10:06:02PM +0200, Nikita Popov wrote: > I'd suggest to split the 32-bit and 64-bit code codepaths entirely, as the > interleaved #ifs are somewhat hard to follow. Something like > https://gist.github.com/nikic/64e7ec58ebb6121d350fb80927a65082 (not > thoroughly tested).
This looks good to me - especially how you reduced the nesting of if's by special-casing the "Powers of two are not biased" return. With this change, you can as well drop the "Special case where no modulus is required", as it'd happen to be handled the same by your new return. OTOH, that optimization might require an extra comment on its own. Here's what this might look like (totally untested): https://gist.github.com/solardiz/5e3d313bbee2c1ce6e200e433b750bef Alexander -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php