diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-07-02 17:41:48 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-07-04 15:05:30 +0200 |
| commit | fcb219b67eb296b6781f81074e9cb5b09163f734 (patch) | |
| tree | cb9adbc1e3df32449593f0da45d60fb6c161e07e /pkg/csource/csource.go | |
| parent | 74cb4e09a50b0f8cc45fce9ac072d1079eb03b42 (diff) | |
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
Diffstat (limited to 'pkg/csource/csource.go')
| -rw-r--r-- | pkg/csource/csource.go | 2 |
1 files changed, 1 insertions, 1 deletions
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") |
