From 8b627dab535ff3cc3311cedf305ddbe67d1cd906 Mon Sep 17 00:00:00 2001 From: Ingo Oeser Date: Sat, 22 Aug 2015 22:59:27 +0200 Subject: [PATCH] empty filenames don't have a suffix so elide that condition. Even the small speed win is marginal, since we just called exec before, which is way more expensive. --- general/gochanges.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/general/gochanges.go b/general/gochanges.go index 02c365b..9918078 100644 --- a/general/gochanges.go +++ b/general/gochanges.go @@ -48,7 +48,7 @@ func GetChangedGoFiles() (result []string) { resultLines := strings.Split(gitDiff, "\n") for _, filename := range resultLines { - if filename != "" && strings.HasSuffix(filename, ".go") { + if strings.HasSuffix(filename, ".go") { result = append(result, absolutePath+"/"+filename) } }