aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/alg.go
diff options
context:
space:
mode:
authorqiulaidongfeng <2645477756@qq.com>2024-04-02 13:08:24 +0000
committerGopher Robot <gobot@golang.org>2024-04-02 15:10:48 +0000
commitdaaf1f222063174eb7f0938eee38f7f9f364263c (patch)
tree4187c39caf622b61276555ab72ad00f1145ad280 /src/runtime/alg.go
parente3ec1ca17e339e21ca50fbdb375b4294783bc385 (diff)
downloadgo-daaf1f222063174eb7f0938eee38f7f9f364263c.tar.xz
all: use kind* of abi
For #59670 Change-Id: Id66e102f13e529dd041b68ce869026a56f0a1b9b GitHub-Last-Rev: 43aa9376f72bc02a9d86518cdc99494a6b2f8573 GitHub-Pull-Request: golang/go#65564 Reviewed-on: https://go-review.googlesource.com/c/go/+/562298 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/alg.go')
-rw-r--r--src/runtime/alg.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/runtime/alg.go b/src/runtime/alg.go
index 93b14accb4..f5125d414f 100644
--- a/src/runtime/alg.go
+++ b/src/runtime/alg.go
@@ -154,30 +154,30 @@ func typehash(t *_type, p unsafe.Pointer, h uintptr) uintptr {
return memhash(p, h, t.Size_)
}
}
- switch t.Kind_ & kindMask {
- case kindFloat32:
+ switch t.Kind_ & abi.KindMask {
+ case abi.Float32:
return f32hash(p, h)
- case kindFloat64:
+ case abi.Float64:
return f64hash(p, h)
- case kindComplex64:
+ case abi.Complex64:
return c64hash(p, h)
- case kindComplex128:
+ case abi.Complex128:
return c128hash(p, h)
- case kindString:
+ case abi.String:
return strhash(p, h)
- case kindInterface:
+ case abi.Interface:
i := (*interfacetype)(unsafe.Pointer(t))
if len(i.Methods) == 0 {
return nilinterhash(p, h)
}
return interhash(p, h)
- case kindArray:
+ case abi.Array:
a := (*arraytype)(unsafe.Pointer(t))
for i := uintptr(0); i < a.Len; i++ {
h = typehash(a.Elem, add(p, i*a.Elem.Size_), h)
}
return h
- case kindStruct:
+ case abi.Struct:
s := (*structtype)(unsafe.Pointer(t))
for _, f := range s.Fields {
if f.Name.IsBlank() {
@@ -204,10 +204,10 @@ func mapKeyError2(t *_type, p unsafe.Pointer) error {
if t.TFlag&abi.TFlagRegularMemory != 0 {
return nil
}
- switch t.Kind_ & kindMask {
- case kindFloat32, kindFloat64, kindComplex64, kindComplex128, kindString:
+ switch t.Kind_ & abi.KindMask {
+ case abi.Float32, abi.Float64, abi.Complex64, abi.Complex128, abi.String:
return nil
- case kindInterface:
+ case abi.Interface:
i := (*interfacetype)(unsafe.Pointer(t))
var t *_type
var pdata *unsafe.Pointer
@@ -236,7 +236,7 @@ func mapKeyError2(t *_type, p unsafe.Pointer) error {
} else {
return mapKeyError2(t, *pdata)
}
- case kindArray:
+ case abi.Array:
a := (*arraytype)(unsafe.Pointer(t))
for i := uintptr(0); i < a.Len; i++ {
if err := mapKeyError2(a.Elem, add(p, i*a.Elem.Size_)); err != nil {
@@ -244,7 +244,7 @@ func mapKeyError2(t *_type, p unsafe.Pointer) error {
}
}
return nil
- case kindStruct:
+ case abi.Struct:
s := (*structtype)(unsafe.Pointer(t))
for _, f := range s.Fields {
if f.Name.IsBlank() {