News for hackers. Stuff that matters.
Re:Fun with Go Iterators by thrww120956 on Friday October 11, 2024 @04:57AM (#41807658)
There's no way to do this (a single instruction loop vs 10 loops with a single instruction) in JS or Golang.
Re:Fun with Go Iterators by tsimionescu on Friday October 11, 2024 @06:06AM (#41808036)
I don't mean assembly-level instructions, just general instructions in the language:

  for i := range arr {
    foo1(arr[i])
    ...
    foo10(arr[i])
  }
Vs

  for i := range arr {
    foo1(arr[i])
  }
  ... 
  for i := range arr {
    foo10(arr[i])
  }