this repo has no description

nitpicks from yesterday's changes (#9)

* µopt: only do one allocation here

* just check if preferences is a key of the prefs obj

i think json.Unmarshal can give u a non-nil guy here and checking for
nil or empty is kinda cringe so let's just do this

authored by charlotte ✨ and committed by GitHub ee7ced39 e29f103c

+1 -1
server/handle_actor_get_preferences.go
··· 14 15 var prefs map[string]any 16 err := json.Unmarshal(repo.Preferences, &prefs) 17 - if err != nil || prefs == nil { 18 prefs = map[string]any{ 19 "preferences": map[string]any{}, 20 }
··· 14 15 var prefs map[string]any 16 err := json.Unmarshal(repo.Preferences, &prefs) 17 + if err != nil || prefs["preferences"] == nil { 18 prefs = map[string]any{ 19 "preferences": map[string]any{}, 20 }
+1 -1
server/handle_repo_describe_repo.go
··· 69 return helpers.ServerError(e, nil) 70 } 71 72 - var collections []string = make([]string, 0) 73 for _, r := range records { 74 collections = append(collections, r.Nsid) 75 }
··· 69 return helpers.ServerError(e, nil) 70 } 71 72 + var collections []string = make([]string, 0, len(records)) 73 for _, r := range records { 74 collections = append(collections, r.Nsid) 75 }