Fix styling

This commit is contained in:
Sam Wedgwood 2023-07-14 13:26:08 +01:00
parent 05e331d6f6
commit 530f42e545
2 changed files with 5 additions and 3 deletions

View file

@ -92,7 +92,8 @@ func QueryRoomHierarchy(req *http.Request, device *userapi.Device, roomIDStr str
limit := 1000 // Default to 1000 limit := 1000 // Default to 1000
limitStr := req.URL.Query().Get("limit") limitStr := req.URL.Query().Get("limit")
if limitStr != "" { if limitStr != "" {
maybeLimit, err := strconv.Atoi(limitStr) var maybeLimit int
maybeLimit, err = strconv.Atoi(limitStr)
if err != nil || maybeLimit < 0 { if err != nil || maybeLimit < 0 {
return util.JSONResponse{ return util.JSONResponse{
Code: http.StatusBadRequest, Code: http.StatusBadRequest,
@ -108,7 +109,8 @@ func QueryRoomHierarchy(req *http.Request, device *userapi.Device, roomIDStr str
maxDepth := -1 // '-1' representing no maximum depth maxDepth := -1 // '-1' representing no maximum depth
maxDepthStr := req.URL.Query().Get("max_depth") maxDepthStr := req.URL.Query().Get("max_depth")
if maxDepthStr != "" { if maxDepthStr != "" {
maybeMaxDepth, err := strconv.Atoi(maxDepthStr) var maybeMaxDepth int
maybeMaxDepth, err = strconv.Atoi(maxDepthStr)
if err != nil || maybeMaxDepth < 0 { if err != nil || maybeMaxDepth < 0 {
return util.JSONResponse{ return util.JSONResponse{
Code: http.StatusBadRequest, Code: http.StatusBadRequest,

View file

@ -574,7 +574,7 @@ func (s RoomSet) Add(val spec.RoomID) {
func (s RoomSet) Copy() RoomSet { func (s RoomSet) Copy() RoomSet {
copied := make(RoomSet, len(s)) copied := make(RoomSet, len(s))
for k, _ := range s { for k := range s {
copied.Add(k) copied.Add(k)
} }
return copied return copied