Skip to content

Commit c93949e

Browse files
committed
refactor(param/strUtil): refine case insensitive map key assign
1 parent 293ed73 commit c93949e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/param/strUtil.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,10 @@ func normalizePathMapsNoCase(inputs []string) map[string]string {
176176
urlPath = util.CleanUrlPath(urlPath)
177177
fsPath = filepath.Clean(fsPath)
178178

179-
for url := range maps {
180-
if strings.EqualFold(url, urlPath) {
181-
delete(maps, url)
179+
for existingUrl := range maps {
180+
if strings.EqualFold(existingUrl, urlPath) {
181+
urlPath = existingUrl
182+
break
182183
}
183184
}
184185

0 commit comments

Comments
 (0)