Skip to content

Commit e2a87c1

Browse files
committed
refactor: remove map use when it isn't needed
1 parent 39303d6 commit e2a87c1

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

generator/generator.go

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1791,18 +1791,13 @@ func stripTypes(parameters string) string {
17911791
}
17921792

17931793
func isExpressionAttributeValueURL(elementName, attrName string) bool {
1794-
var elementAttributeLookup = map[string]string{
1795-
"a": "href",
1796-
"form": "action",
1797-
"link": "href",
1798-
"object": "data",
1799-
}
1800-
expectedAttribute, exists := elementAttributeLookup[elementName]
1801-
if !exists {
1802-
return false
1803-
}
1804-
if attrName != expectedAttribute {
1805-
return false
1794+
switch elementName {
1795+
case "a", "link":
1796+
return attrName == "href"
1797+
case "form":
1798+
return attrName == "action"
1799+
case "object":
1800+
return attrName == "data"
18061801
}
1807-
return true
1802+
return false
18081803
}

0 commit comments

Comments
 (0)