• @[email protected]
    link
    fedilink
    17 months ago

    You still need to read the variable in each iteration, but the cost of that is probably negligible

    • Ryan
      link
      English
      4
      edit-2
      7 months ago

      Modern optimizing compilers are magical. I would need to check assembly but I would actually expect the if to be hoisted out of the loop entirely to relieve pressure on the branch predictor.