• auf@lemmy.ml
    link
    fedilink
    arrow-up
    60
    arrow-down
    1
    ·
    1 year ago

    Thief way is actually the best among all of these imo, in terms of readability and efficiency.

        • Demonen@lemmy.ml
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          If you’re optimizing that hard you should probably sort the data first anyway, but yeah, sometimes it’s absolutely called for. Not that I’ve actually needed that in my professional career, but then again I’ve never worked close enough to metal for it to actually matter.

          That said, all of these are implemented as functions, so they’re already costing the function call anyway…

    • snowe@programming.dev
      link
      fedilink
      arrow-up
      14
      arrow-down
      1
      ·
      1 year ago

      They’re setting a variable to a function. Just use the original function. All thief does is obfuscate for literally no gain except character count.