diff options
| author | Russ Cox <rsc@golang.org> | 2015-01-18 12:50:22 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2015-01-19 02:19:17 +0000 |
| commit | fd4dc91a96518fdbb47781f97ba43ae36df215a5 (patch) | |
| tree | 1bfe9dca937db5ad6c7fb9a3b49e21b529ab5303 /src/strings/strings_decl.go | |
| parent | e832043e7293cf3237e35ffc3b645c8d04d11f77 (diff) | |
| download | go-fd4dc91a96518fdbb47781f97ba43ae36df215a5.tar.xz | |
strings: remove overengineered Compare implementation
The function is here ONLY for symmetry with package bytes.
This function should be used ONLY if it makes code clearer.
It is not here for performance. Remove any performance benefit.
If performance becomes an issue, the compiler should be fixed to
recognize the three-way compare (for all comparable types)
rather than encourage people to micro-optimize by using this function.
Change-Id: I71f4130bce853f7aef724c6044d15def7987b457
Reviewed-on: https://go-review.googlesource.com/3012
Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/strings/strings_decl.go')
| -rw-r--r-- | src/strings/strings_decl.go | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/strings/strings_decl.go b/src/strings/strings_decl.go index 9dc2a9a6c6..810a696af2 100644 --- a/src/strings/strings_decl.go +++ b/src/strings/strings_decl.go @@ -6,10 +6,3 @@ package strings // IndexByte returns the index of the first instance of c in s, or -1 if c is not present in s. func IndexByte(s string, c byte) int // ../runtime/asm_$GOARCH.s - -// Compare returns an integer comparing two strings lexicographically. -// The result will be 0 if a==b, -1 if a < b, and +1 if a > b. -// -// In most cases it is simpler to use the built-in comparison operators -// ==, <, >, and so on. -func Compare(a, b string) int // ../runtime/noasm.go or ../runtime/asm_*.s |
