Skip to content

Commit ad9a2eb

Browse files
authored
huffman/test: Delete unused field "reverse" (#62)
The alphabet type wasn't using this at all.
1 parent dfba0be commit ad9a2eb

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

internal/huffman/huffman_test.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,12 @@ import (
1414
// Index based test cases are difficult to read. Set up some machinery to write
1515
// more readable test cases.
1616
type alphabet struct {
17-
items []rune
18-
reverse map[rune]int // index into items
17+
items []rune
1918
}
2019

2120
func newAlphabet(chars string) *alphabet {
2221
items := []rune(chars)
23-
reverse := make(map[rune]int, len(items))
24-
for i, r := range items {
25-
reverse[r] = i
26-
}
27-
return &alphabet{items: items, reverse: reverse}
22+
return &alphabet{items: items}
2823
}
2924

3025
func (a *alphabet) String() string {

0 commit comments

Comments
 (0)