Reduced memory usage
This commit is contained in:
@ -37,8 +37,8 @@ func (expr *Expression) AddChild(child *Expression) {
|
||||
}
|
||||
|
||||
// Count counts how often the given token appears in the expression.
|
||||
func (expr *Expression) Count(buffer []byte, kind token.Kind, name string) int {
|
||||
count := 0
|
||||
func (expr *Expression) Count(buffer []byte, kind token.Kind, name string) uint8 {
|
||||
count := uint8(0)
|
||||
|
||||
expr.EachLeaf(func(leaf *Expression) error {
|
||||
if leaf.Token.Kind == kind && leaf.Token.Text(buffer) == name {
|
||||
|
Reference in New Issue
Block a user