fix(hermes): The lookup accepts exactly the same ASCII letters, digits, underscore, and hyphen as the original predicate, without altering sanitization behavior. It is a localized one-line source change that reduces the method's cognitive complexity. (incident sonar/pegasus/go:S3776/AZ4V2tkdqCRMjDT4bXBr)
This commit is contained in:
parent
fe83ebca09
commit
45051b43ee
@ -28,7 +28,7 @@ func sanitizeDescriptor(s string) string {
|
|||||||
var b []rune
|
var b []rune
|
||||||
lastUnderscore := false
|
lastUnderscore := false
|
||||||
for _, r := range s {
|
for _, r := range s {
|
||||||
ok := (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') || (r >= '0' && r <= '9') || r == '_' || r == '-'
|
ok := strings.ContainsRune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-", r)
|
||||||
if !ok {
|
if !ok {
|
||||||
r = '_'
|
r = '_'
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user