Hacker News new | past | comments | ask | show | jobs | submit login

> Giving maps a runtime penalty of random iteration in order just to punish devs who don't read docs is annoying

Can you explain what you mean by "runtime penalty?" Last I checked, the iteration is only random wrt its starting offset; after that, it proceeds linearly through the buckets. So you only generate one random integer per `range`, which seems acceptably cheap.




It still seems to be working as you described.

https://github.com/golang/go/blob/db8142fb8631df3ee56983cbc1...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: