Update: the much better answer has little to do with refactoring, but has to do with setting a default for empty keys. See the first answer- thanks a lot guys!
Hi folks, how would you refactor this?
if n=network_stats["b"]
network_stats["b"] = n +1
else
network_stats["b"]=1
end
I have a nagging feeling this can be done in 2 lines