Skip to content

Commit 830f8f2

Browse files
author
Federico Fissore
committed
Extracted function for readability
Signed-off-by: Federico Fissore <f.fissore@arduino.cc>
1 parent 9f371d2 commit 830f8f2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/arduino.cc/builder/ctags_parser.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,15 @@ func prototypeAndCodeDontMatch(tag map[string]string) bool {
180180

181181
code := removeSpacesAndTabs(tag[FIELD_CODE])
182182
prototype := removeSpacesAndTabs(tag[KIND_PROTOTYPE])
183-
prototype = prototype[0 : len(prototype)-1]
183+
prototype = removeTralingSemicolon(prototype)
184184

185185
return strings.Index(code, prototype) == -1
186186
}
187187

188+
func removeTralingSemicolon(s string) string {
189+
return s[0 : len(s)-1]
190+
}
191+
188192
func removeSpacesAndTabs(s string) string {
189193
s = strings.Replace(s, " ", "", -1)
190194
s = strings.Replace(s, "\t", "", -1)

0 commit comments

Comments
 (0)