3 ms·
Can the optimizer not eliminate the redundant bounds checks in the "good idiomatic" version?
by bluesnowmonkey 15y ago
Can the optimizer not eliminate the redundant bounds checks in the "good idiomatic" version?
- alec 15y agoCheck the first comment in the article - I can't believe that is actually good and idiomatic. The author uses the indexes, but the range command also supports returning the values. To be fair, I have a lot of difficulty figuring out what's a reference and what's a value in Go; I suspect if it were an int and not a struct, that wouldn't work.
- dhconnelly 15y agoOnly slices, maps, and channels are reference types.