Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The end state could be a map[string]struct{}, since it is only used to test the presence of the string. The bool value is unused, and an empty struct takes no memory, so it would be an admittedly tiny optimization.

Related: Rob Pikes' lexical scanning talk (state machines in Go): http://blog.golang.org/2011/09/two-go-talks-lexical-scanning...



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

Search: