remove runtime.NewString
This commit is contained in:
Binary file not shown.
@@ -31,11 +31,6 @@ type Slice struct {
|
||||
cap int
|
||||
}
|
||||
|
||||
// NilSlice returns a nil slice.
|
||||
func NilSlice() Slice {
|
||||
return Slice{nil, 0, 0}
|
||||
}
|
||||
|
||||
// NewSlice creates a new slice.
|
||||
func NewSlice(data unsafe.Pointer, len, cap int) Slice {
|
||||
return Slice{data, len, cap}
|
||||
@@ -55,21 +50,6 @@ func NewSlice3(base unsafe.Pointer, eltSize, cap, i, j, k int) (s Slice) {
|
||||
return
|
||||
}
|
||||
|
||||
// SliceLen returns the length of a slice.
|
||||
func SliceLen(s Slice) int {
|
||||
return s.len
|
||||
}
|
||||
|
||||
// SliceCap returns the capacity of a slice.
|
||||
func SliceCap(s Slice) int {
|
||||
return s.cap
|
||||
}
|
||||
|
||||
// SliceData returns the data pointer of a slice.
|
||||
func SliceData(s Slice) unsafe.Pointer {
|
||||
return s.data
|
||||
}
|
||||
|
||||
// SliceAppend append elem data and returns a slice.
|
||||
func SliceAppend(src Slice, data unsafe.Pointer, num, etSize int) Slice {
|
||||
if etSize == 0 {
|
||||
|
||||
@@ -35,17 +35,6 @@ type String struct {
|
||||
len int
|
||||
}
|
||||
|
||||
// EmptyString returns an empty string.
|
||||
func EmptyString() String {
|
||||
return String{nil, 0}
|
||||
}
|
||||
|
||||
// TODO(xsw): unsafe.String
|
||||
// NewString creates a new string.
|
||||
func NewString(data unsafe.Pointer, len int) String {
|
||||
return String{data, len}
|
||||
}
|
||||
|
||||
// StringCat concatenates two strings.
|
||||
func StringCat(a, b String) String {
|
||||
n := a.len + b.len
|
||||
|
||||
Reference in New Issue
Block a user