cm0002@lemmy.world to Programmer Humor@programming.dev · 5 days agoInfallible Codefeddit.ukimagemessage-square42fedilinkarrow-up1224arrow-down114
arrow-up1210arrow-down1imageInfallible Codefeddit.ukcm0002@lemmy.world to Programmer Humor@programming.dev · 5 days agomessage-square42fedilink
minus-squareprime_number_314159@lemmy.worldlinkfedilinkarrow-up2·4 days 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.