You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by ro...@apache.org on 2024/08/21 07:13:13 UTC
(incubator-answer) 12/49: perf: remove invalid nil pointer check in Translate function
This is an automated email from the ASF dual-hosted git repository.
robin0716 pushed a commit to branch develop/robin
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git
commit 628c5f796d1701ea8f0e471723325e9167a68284
Author: Sonui <me...@sonui.cn>
AuthorDate: Wed Aug 7 22:51:23 2024 +0800
perf: remove invalid nil pointer check in Translate function
---
plugin/plugin.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugin/plugin.go b/plugin/plugin.go
index 61ed0d8f..85286855 100644
--- a/plugin/plugin.go
+++ b/plugin/plugin.go
@@ -219,7 +219,7 @@ func MakeTranslator(key string) Translator {
// Translate translates the key to the current language of the context
func (t Translator) Translate(ctx *GinContext) string {
- if &t == nil || t.Fn == nil {
+ if t.Fn == nil {
return ""
}
return t.Fn(ctx)