aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/string1.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2015-02-13 12:09:12 +0900
committerIan Lance Taylor <iant@golang.org>2015-02-16 04:07:19 +0000
commit7b36227002b8b442a55dfb975490a861a8aa2ff2 (patch)
treede3e8d850ca8aca8910c071fe76eba797524da3c /src/runtime/string1.go
parentf10e03770c9702b3ee3bcc2ccdb78691f389c1a3 (diff)
downloadgo-7b36227002b8b442a55dfb975490a861a8aa2ff2.tar.xz
runtime: remove C-style strcmp and strncmp helpers
Change-Id: I4aa23e3a0e765651c91907507a0194fd528b6223 Reviewed-on: https://go-review.googlesource.com/4662 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/string1.go')
-rw-r--r--src/runtime/string1.go39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/runtime/string1.go b/src/runtime/string1.go
index 35cde43be0..feeb341b62 100644
--- a/src/runtime/string1.go
+++ b/src/runtime/string1.go
@@ -67,42 +67,3 @@ func gostringw(strw *uint16) string {
b[n2] = 0 // for luck
return s[:n2]
}
-
-func strcmp(s1, s2 *byte) int32 {
- p1 := (*[_MaxMem/2 - 1]byte)(unsafe.Pointer(s1))
- p2 := (*[_MaxMem/2 - 1]byte)(unsafe.Pointer(s2))
-
- for i := uintptr(0); ; i++ {
- c1 := p1[i]
- c2 := p2[i]
- if c1 < c2 {
- return -1
- }
- if c1 > c2 {
- return +1
- }
- if c1 == 0 {
- return 0
- }
- }
-}
-
-func strncmp(s1, s2 *byte, n uintptr) int32 {
- p1 := (*[_MaxMem/2 - 1]byte)(unsafe.Pointer(s1))
- p2 := (*[_MaxMem/2 - 1]byte)(unsafe.Pointer(s2))
-
- for i := uintptr(0); i < n; i++ {
- c1 := p1[i]
- c2 := p2[i]
- if c1 < c2 {
- return -1
- }
- if c1 > c2 {
- return +1
- }
- if c1 == 0 {
- break
- }
- }
- return 0
-}