From fcb219b67eb296b6781f81074e9cb5b09163f734 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 2 Jul 2020 17:41:48 +0200 Subject: all: don't compare string len with 0 For strings it's more readable to compare the string itself with "", instead of comparing len with 0. Fix all such cases. Update #1876 --- pkg/csource/csource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/csource/csource.go') diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go index 2799920e3..4126e2b02 100644 --- a/pkg/csource/csource.go +++ b/pkg/csource/csource.go @@ -249,7 +249,7 @@ func (ctx *context) emitCall(w *bytes.Buffer, call prog.ExecCall, ci int, haveCo } fmt.Fprintf(w, ");") comment := ctx.target.AnnotateCall(call) - if len(comment) != 0 { + if comment != "" { fmt.Fprintf(w, " /* %s */", comment) } fmt.Fprintf(w, "\n") -- cgit mrf-deployment