From 070ef6732d05c675c847c99f1ee95c79e45b1378 Mon Sep 17 00:00:00 2001 From: Marvin Blum Date: Sun, 25 Oct 2015 19:33:09 +0100 Subject: [PATCH] Small improvements to for. --- src/asl/tokenizer.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/asl/tokenizer.go b/src/asl/tokenizer.go index d54caa1..142c49b 100644 --- a/src/asl/tokenizer.go +++ b/src/asl/tokenizer.go @@ -85,7 +85,7 @@ func Tokenize(code []byte) []Token { tokens = append(tokens, Token{string(c)}) token = "" - } else if stringArrayContains(keywords, strings.ToLower(token)) && !isIdentifierCharacter(c) { + } else if stringArrayContains(strings.ToLower(token)) && !isIdentifierCharacter(c) { tokens = append(tokens, Token{token}) token = "" } else if !byteArrayContains(whitespace, c) { @@ -179,9 +179,9 @@ func byteArrayContains(haystack []byte, needle byte) bool { } // Checks if a byte array (string) contains a string delimeter. -func stringArrayContains(haystack []string, needle string) bool { - for i := range haystack { - if haystack[i] == needle { +func stringArrayContains(needle string) bool { + for i := range keywords { + if keywords[i] == needle { return true } }