diff --git a/state/state.go b/state/state.go index 2206555..5cd3167 100644 --- a/state/state.go +++ b/state/state.go @@ -50,7 +50,7 @@ func (st State) Clone() *State { // Returns old index func (st *State) IncrementSymbol(symbol byte) int { - node := st.bySymbol[symbol] + node := st.nodeFromSymbol(symbol) node.count++ origIndex := node.index @@ -85,3 +85,7 @@ func (st State) String() string { return strings.Join(strs, ", ") } + +func (st State) nodeFromSymbol(symbol byte) *node { + return st.bySymbol[symbol] +}