cm0002@lemmy.world to Programmer Humor@programming.dev · 2 months agoInfallible Codeimagemessage-square57linkfedilinkarrow-up1300arrow-down118
arrow-up1282arrow-down1imageInfallible Codecm0002@lemmy.world to Programmer Humor@programming.dev · 2 months agomessage-square57linkfedilink
minus-squareprime_number_314159@lemmy.worldlinkfedilinkarrow-up3·1 month agoIf small numbers are much more frequent, it’s better to return early. Really, you should gather statistics about the numbers the function is called with, and put the most frequent ones at the top.
If small numbers are much more frequent, it’s better to return early. Really, you should gather statistics about the numbers the function is called with, and put the most frequent ones at the top.