From 022ba1c0674ff6539f02e7d585ad618eb2c33bcc Mon Sep 17 00:00:00 2001 From: xgopilot Date: Fri, 31 Oct 2025 02:28:17 +0000 Subject: [PATCH] refactor(runtime): combine two if cases in methods() function Simplified the methods() function in z_face.go by combining two if statements that both return u.Methods() into a single condition using logical OR operator. Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com> --- runtime/internal/runtime/z_face.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/runtime/internal/runtime/z_face.go b/runtime/internal/runtime/z_face.go index 7312f544..364853de 100644 --- a/runtime/internal/runtime/z_face.go +++ b/runtime/internal/runtime/z_face.go @@ -396,10 +396,7 @@ func findMethod(mthds []abi.Method, im abi.Imethod) abi.Text { } func methods(u *abi.UncommonType, from string) []abi.Method { - if from == "" { - return u.Methods() - } - if u.PkgPath_ == from { + if from == "" || u.PkgPath_ == from { return u.Methods() } return u.ExportedMethods()