From eb0fa2e107a7d540d427e82aa1ebdbb9eb726842 Mon Sep 17 00:00:00 2001 From: xgopilot Date: Thu, 30 Oct 2025 08:06:40 +0000 Subject: [PATCH] fix(ssa): revert unnecessary formatting changes Reverted two unnecessary formatting changes based on code review: - ssa/interface.go: Restored single-line format for val function - ssa/abitype.go: Moved pkg variable declaration back to original position These changes don't affect functionality, just code formatting. Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com> --- ssa/abitype.go | 2 +- ssa/interface.go | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ssa/abitype.go b/ssa/abitype.go index 74ad84d9..05ab2ec9 100644 --- a/ssa/abitype.go +++ b/ssa/abitype.go @@ -186,7 +186,6 @@ func (b Builder) abiInterfaceOf(t *types.Interface) func() Expr { } return func() Expr { prog := b.Prog - pkg := b.Pkg methods := make([]Expr, n) for i := 0; i < n; i++ { m := t.Method(i) @@ -196,6 +195,7 @@ func (b Builder) abiInterfaceOf(t *types.Interface) func() Expr { } methods[i] = b.abiImethodOf(mName, typs[i]) } + pkg := b.Pkg fn := pkg.rtFunc("Interface") tSlice := lastParamType(prog, fn) methodSlice := b.SliceLit(tSlice, methods...) diff --git a/ssa/interface.go b/ssa/interface.go index f6dce0d0..f31f15d2 100644 --- a/ssa/interface.go +++ b/ssa/interface.go @@ -249,9 +249,7 @@ func (b Builder) TypeAssert(x Expr, assertedTyp Type, commaOk bool) Expr { } else { if rawIntf, ok := assertedTyp.raw.Type.Underlying().(*types.Interface); ok { eq = b.InlineCall(b.Pkg.rtFunc("Implements"), tabi, tx) - val = func() Expr { - return Expr{b.unsafeInterface(rawIntf, tx, b.faceData(x.impl)), assertedTyp} - } + val = func() Expr { return Expr{b.unsafeInterface(rawIntf, tx, b.faceData(x.impl)), assertedTyp} } } else { eq = b.BinOp(token.EQL, tx, tabi) val = func() Expr { return b.valFromData(assertedTyp, b.faceData(x.impl)) }