diff options
| author | David Crawshaw <david.crawshaw@zentus.com> | 2014-08-28 12:07:52 -0400 |
|---|---|---|
| committer | David Crawshaw <david.crawshaw@zentus.com> | 2014-08-28 12:07:52 -0400 |
| commit | 5ea131f442cf1bb1fa9ce1029054838af974f0e8 (patch) | |
| tree | bde96965cc487e16ee8c780a096bea3d6e119ad7 /src | |
| parent | f852034eb0e3f1397d5510b900d8c8dbf8b18746 (diff) | |
| download | go-5ea131f442cf1bb1fa9ce1029054838af974f0e8.tar.xz | |
runtime: compare only until min(len(s1), len(s2))
LGTM=bradfitz
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/139770043
Diffstat (limited to 'src')
| -rw-r--r-- | src/pkg/runtime/noasm_arm.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/runtime/noasm_arm.go b/src/pkg/runtime/noasm_arm.go index 01f4116f2a..dd3ef82676 100644 --- a/src/pkg/runtime/noasm_arm.go +++ b/src/pkg/runtime/noasm_arm.go @@ -9,7 +9,7 @@ package runtime func cmpstring(s1, s2 string) int { l := len(s1) - if l < len(s2) { + if len(s2) < l { l = len(s2) } for i := 0; i < l; i++ { @@ -32,7 +32,7 @@ func cmpstring(s1, s2 string) int { func cmpbytes(s1, s2 []byte) int { l := len(s1) - if l < len(s2) { + if len(s2) < l { l = len(s2) } for i := 0; i < l; i++ { |
