Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: rm unnecessary abstraction func
  • Loading branch information
AsperforMias committed May 31, 2026
commit d09106249d21893bc2e219392ec5b694452b5c5b
10 changes: 1 addition & 9 deletions metadata/info/metadata_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package info

import (
"net/url"
"slices"
"strconv"
"strings"
)
Expand Down Expand Up @@ -114,7 +113,7 @@ func addUrl(m map[string][]*common.URL, url *common.URL) {
func removeUrl(m map[string][]*common.URL, url *common.URL) {
if urls, ok := m[url.ServiceKey()]; ok {
for i, u := range urls {
if urlEqual(u, url) {
if u.URLEqual(url) {
m[url.ServiceKey()] = deleteItem(urls, i)
break
}
Expand All @@ -125,13 +124,6 @@ func removeUrl(m map[string][]*common.URL, url *common.URL) {
}
}

func urlEqual(left, right *common.URL) bool {
if left == nil || right == nil {
return left == right
}
return left.String() == right.String() && slices.Equal(left.Methods, right.Methods)
}

func deleteItem(slice []*common.URL, index int) []*common.URL {
copy(slice[index:], slice[index+1:])
slice = slice[:len(slice)-1]
Expand Down
Loading