]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: test for lower-case letters first in isAlpha
authorRobert Griesemer <gri@golang.org>
Sat, 20 Feb 2016 19:16:21 +0000 (11:16 -0800)
committerRobert Griesemer <gri@golang.org>
Sun, 21 Feb 2016 05:12:38 +0000 (05:12 +0000)
Lower-case letters are more common in identifiers.

Change-Id: I49c39e3ac810eea57d15c1433608daec212c9792
Reviewed-on: https://go-review.googlesource.com/19760
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/lex.go

index a6f65bec624218a2b4a56b1e216060ff644fb855..55d988b70aa2ce93098d00112ec4b2490d78091f 100644 (file)
@@ -832,7 +832,7 @@ func isSpace(c int) bool {
 }
 
 func isAlpha(c int) bool {
-       return 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z'
+       return 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z'
 }
 
 func isDigit(c int) bool {