nodeFromSymbol()

This commit is contained in:
Ian Gulliver
2023-12-31 14:41:26 -08:00
parent 089e96dca3
commit 04f1ef728f

View File

@@ -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]
}