aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime/string.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/runtime/string.go')
-rw-r--r--libgo/go/runtime/string.go50
1 files changed, 0 insertions, 50 deletions
diff --git a/libgo/go/runtime/string.go b/libgo/go/runtime/string.go
index c0058be..44b9314 100644
--- a/libgo/go/runtime/string.go
+++ b/libgo/go/runtime/string.go
@@ -327,22 +327,6 @@ func gostringn(p *byte, l int) string {
return s
}
-func index(s, t string) int {
- if len(t) == 0 {
- return 0
- }
- for i := 0; i < len(s); i++ {
- if s[i] == t[0] && hasPrefix(s[i:], t) {
- return i
- }
- }
- return -1
-}
-
-func contains(s, t string) bool {
- return index(s, t) >= 0
-}
-
func hasPrefix(s, prefix string) bool {
return len(s) >= len(prefix) && s[:len(prefix)] == prefix
}
@@ -512,37 +496,3 @@ func __go_byte_array_to_string(p unsafe.Pointer, l int) string {
func __go_string_to_byte_array(s string) []byte {
return stringtoslicebyte(nil, s)
}
-
-// parseRelease parses a dot-separated version number. It follows the
-// semver syntax, but allows the minor and patch versions to be
-// elided.
-func parseRelease(rel string) (major, minor, patch int, ok bool) {
- // Strip anything after a dash or plus.
- for i := 0; i < len(rel); i++ {
- if rel[i] == '-' || rel[i] == '+' {
- rel = rel[:i]
- break
- }
- }
-
- next := func() (int, bool) {
- for i := 0; i < len(rel); i++ {
- if rel[i] == '.' {
- ver, ok := atoi(rel[:i])
- rel = rel[i+1:]
- return ver, ok
- }
- }
- ver, ok := atoi(rel)
- rel = ""
- return ver, ok
- }
- if major, ok = next(); !ok || rel == "" {
- return
- }
- if minor, ok = next(); !ok || rel == "" {
- return
- }
- patch, ok = next()
- return
-}