Skip to content

Commit 6145171

Browse files
authored
Merge pull request #829 from kennygt51/is_kro_reserver
perf: optimize isKROReservedWord function
2 parents 64da0cb + 8861260 commit 6145171

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

pkg/graph/validation.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,7 @@ func isValidKindName(name string) bool {
9898

9999
// isKROReservedWord checks if the given word is a reserved word in KRO.
100100
func isKROReservedWord(word string) bool {
101-
for _, w := range reservedKeyWords.List() {
102-
if w == word {
103-
return true
104-
}
105-
}
106-
return false
101+
return reservedKeyWords.Has(word)
107102
}
108103

109104
// validateResourceGraphDefinitionNamingConventions validates the naming conventions of

0 commit comments

Comments
 (0)