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.
This commit is contained in:
parent
d06d40e71a
commit
8b627dab53
|
@ -48,7 +48,7 @@ func GetChangedGoFiles() (result []string) {
|
||||||
|
|
||||||
resultLines := strings.Split(gitDiff, "\n")
|
resultLines := strings.Split(gitDiff, "\n")
|
||||||
for _, filename := range resultLines {
|
for _, filename := range resultLines {
|
||||||
if filename != "" && strings.HasSuffix(filename, ".go") {
|
if strings.HasSuffix(filename, ".go") {
|
||||||
result = append(result, absolutePath+"/"+filename)
|
result = append(result, absolutePath+"/"+filename)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user