Skip to content

Commit 951f1f9

Browse files
author
Federico Fissore
committed
Extracted function for readability
Signed-off-by: Federico Fissore <[email protected]>
1 parent 3081e19 commit 951f1f9

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
@@ -189,11 +189,15 @@ func prototypeAndCodeDontMatch(tag map[string]string) bool {
189189

190190
code := removeSpacesAndTabs(tag[FIELD_CODE])
191191
prototype := removeSpacesAndTabs(tag[KIND_PROTOTYPE])
192-
prototype = prototype[0 : len(prototype)-1]
192+
prototype = removeTralingSemicolon(prototype)
193193

194194
return strings.Index(code, prototype) == -1
195195
}
196196

197+
func removeTralingSemicolon(s string) string {
198+
return s[0 : len(s)-1]
199+
}
200+
197201
func removeSpacesAndTabs(s string) string {
198202
s = strings.Replace(s, " ", "", -1)
199203
s = strings.Replace(s, "\t", "", -1)

0 commit comments

Comments
 (0)