Reduced memory usage
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
package token
|
||||
|
||||
// Count counts how often the given token appears in the token list.
|
||||
func Count(tokens []Token, buffer []byte, kind Kind, name string) int {
|
||||
count := 0
|
||||
func Count(tokens []Token, buffer []byte, kind Kind, name string) uint8 {
|
||||
count := uint8(0)
|
||||
|
||||
for _, t := range tokens {
|
||||
if t.Kind == Identifier && t.Text(buffer) == name {
|
||||
|
Reference in New Issue
Block a user