Skip to content

Commit e1791f7

Browse files
committed
use getmapkeys
1 parent a9dac0c commit e1791f7

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

pkg/suggestion/suggestion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func fetchBookmarkSuggestions(_ context.Context, data wshrpc.FetchSuggestionsDat
165165
var scoredEntries []scoredEntry
166166
var slab util.Slab
167167

168-
bookmarkKeys := utilfn.GetKeys[wconfig.WebBookmark](bookmarks)
168+
bookmarkKeys := utilfn.GetMapKeys(bookmarks)
169169
// sort by display:order and then by key
170170
sort.Slice(bookmarkKeys, func(i, j int) bool {
171171
bookmarkA := bookmarks[bookmarkKeys[i]]

pkg/util/utilfn/utilfn.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,11 +1023,3 @@ func QuickHashString(s string) string {
10231023
h.Write([]byte(s))
10241024
return base64.RawURLEncoding.EncodeToString(h.Sum(nil))
10251025
}
1026-
1027-
func GetKeys[T any](m map[string]T) []string {
1028-
keys := make([]string, 0, len(m))
1029-
for key := range m {
1030-
keys = append(keys, key)
1031-
}
1032-
return keys
1033-
}

0 commit comments

Comments
 (0)