mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 02:57:46 +00:00
Move string type to runtime in separate file
This commit is contained in:
@@ -21,18 +21,6 @@ func GOMAXPROCS(n int) int {
|
||||
return 1
|
||||
}
|
||||
|
||||
func stringequal(x, y string) bool {
|
||||
if len(x) != len(y) {
|
||||
return false
|
||||
}
|
||||
for i := 0; i < len(x); i++ {
|
||||
if x[i] != y[i] {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Copy size bytes from src to dst. The memory areas must not overlap.
|
||||
func memcpy(dst, src unsafe.Pointer, size uintptr) {
|
||||
for i := uintptr(0); i < size; i++ {
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package runtime
|
||||
|
||||
// This file implements functions related to Go strings.
|
||||
|
||||
type _string struct {
|
||||
length lenType
|
||||
ptr *uint8
|
||||
}
|
||||
|
||||
func stringEqual(x, y string) bool {
|
||||
if len(x) != len(y) {
|
||||
return false
|
||||
}
|
||||
for i := 0; i < len(x); i++ {
|
||||
if x[i] != y[i] {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user