3 ms·
and its an optimization the ruby version doesn't necessarily have. you could have just as easily written: var names []string for i, user := range users
by jatone 5y ago
and its an optimization the ruby version doesn't necessarily have. you could have just as easily written:
var names []string
for i, user := range users {
if user.isAdmin {
names = append(names, user.Name)
}
}
and hilariously it likely still would be faster than ruby. I've managed large golang and ruby projects and the difference in maintenance work between the two is insane and its not a good look for ruby.