Hacker News new | ask | show | jobs
by SergeAx 1861 days ago
And inserting N elements into slice would be?..
1 comments

the slice already exists in this context, that cost is already incurred.
"this context" is using a map from the beginning and not having that slice.
“This context” is also not known except one specific way in which the data is accessed, so blithely saying “I’d use a map instead” and being sure that’s the right answer in all cases is pretty uninformed.

It helps to assume the person who chose a slice did it for some actual reason and not because they are an idiot.