diff options
author | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2021-02-17 15:14:21 +0700 |
---|---|---|
committer | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2021-02-23 06:01:29 +0000 |
commit | e52149822b54811cedaaa87013de3fa4bc634e95 (patch) | |
tree | 34bdc306bf2c00c662add4a459ea5dcff0e4d670 /src/cmd/compile/internal/typecheck/builtin | |
parent | 86deb459de6a309503aa445a7d686bd139354e5e (diff) | |
download | go-e52149822b54811cedaaa87013de3fa4bc634e95.tar.gz go-e52149822b54811cedaaa87013de3fa4bc634e95.zip |
cmd/compile: simplify assert{E,I}2I{,2} calling conventions
This CL rebases CL 273694 on top of master with @mdempsky's permission.
For assertE2I and assertI2I, there's no need to pass through the
interface's data pointer: it's always going to come back unmodified.
For assertE2I2 and assertI2I2, there's no need for an extra bool
result parameter: it's redundant with testing the returned interface
value for nil.
Change-Id: Ic92d4409ad381952f875d3d74b8cf11c32702fa6
Reviewed-on: https://go-review.googlesource.com/c/go/+/292892
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/typecheck/builtin')
-rw-r--r-- | src/cmd/compile/internal/typecheck/builtin/runtime.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/typecheck/builtin/runtime.go b/src/cmd/compile/internal/typecheck/builtin/runtime.go index ad82a9b349..d5e00afcf8 100644 --- a/src/cmd/compile/internal/typecheck/builtin/runtime.go +++ b/src/cmd/compile/internal/typecheck/builtin/runtime.go @@ -101,10 +101,10 @@ func convT2I(tab *byte, elem *any) (ret any) func convT2Inoptr(tab *byte, elem *any) (ret any) // interface type assertions x.(T) -func assertE2I(typ *byte, iface any) (ret any) -func assertE2I2(typ *byte, iface any) (ret any, b bool) -func assertI2I(typ *byte, iface any) (ret any) -func assertI2I2(typ *byte, iface any) (ret any, b bool) +func assertE2I(inter *byte, typ *byte) *byte +func assertE2I2(inter *byte, eface any) (ret any) +func assertI2I(inter *byte, tab *byte) *byte +func assertI2I2(inter *byte, iface any) (ret any) func panicdottypeE(have, want, iface *byte) func panicdottypeI(have, want, iface *byte) func panicnildottype(want *byte) |