cm0002@lemmy.world to Programmer Humor@programming.dev · 1 year agoInfallible Codefeddit.ukimagemessage-square27linkfedilinkarrow-up1190
arrow-up1190imageInfallible Codefeddit.ukcm0002@lemmy.world to Programmer Humor@programming.dev · 1 year agomessage-square27linkfedilink
minus-squareprime_number_314159@lemmy.worldlinkfedilinkarrow-up2·1 year 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.