cm0002@lemmy.world to Programmer Humor@programming.dev · 2 days agoInfallible Codefeddit.ukimagemessage-square54fedilinkarrow-up1275arrow-down118
arrow-up1257arrow-down1imageInfallible Codefeddit.ukcm0002@lemmy.world to Programmer Humor@programming.dev · 2 days agomessage-square54fedilink
minus-squareprime_number_314159@lemmy.worldlinkfedilinkarrow-up3·24 hours 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.