• brian@programming.dev
    link
    fedilink
    arrow-up
    5
    ·
    15 hours ago

    found the following in our codebase the other day.

    while(booleanFlag)
        return;
    

    thhere wasn’t more in the loop body, that was it. the loop conditional does exist and it can hurt you.

    • Rikudou_SageA
      link
      fedilink
      arrow-up
      2
      ·
      11 hours ago

      Can it hurt you, though? My guess would be every sane compiler and interpreter optimizes this.