cm0002@lemmy.world to Programmer Humor@programming.dev · 5 months agoInfallible Codefeddit.ukimagemessage-square51linkfedilinkarrow-up1288
arrow-up1288imageInfallible Codefeddit.ukcm0002@lemmy.world to Programmer Humor@programming.dev · 5 months agomessage-square51linkfedilink
minus-squareprime_number_314159@lemmy.worldlinkfedilinkarrow-up3·5 months 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.