Re:Migrated WordGap from Python to Go 1
by earthboundkid on Saturday March 23, 2013 @10:40PM
(#5430844)
If the original Python is d[key] = d.get(key, 0) + value, in Go it can be replaced with m[key] += value, since the default value for a map[string]int value is 0. This doesn't totally replace the need for defaultdicts, but it should greatly lessen it.
[ Parent
| on HN ]
There are no comments on this comment yet.