mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-09 15:13:12 -06:00
Fix styling
This commit is contained in:
parent
05e331d6f6
commit
530f42e545
|
|
@ -92,7 +92,8 @@ func QueryRoomHierarchy(req *http.Request, device *userapi.Device, roomIDStr str
|
|||
limit := 1000 // Default to 1000
|
||||
limitStr := req.URL.Query().Get("limit")
|
||||
if limitStr != "" {
|
||||
maybeLimit, err := strconv.Atoi(limitStr)
|
||||
var maybeLimit int
|
||||
maybeLimit, err = strconv.Atoi(limitStr)
|
||||
if err != nil || maybeLimit < 0 {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
|
|
@ -108,7 +109,8 @@ func QueryRoomHierarchy(req *http.Request, device *userapi.Device, roomIDStr str
|
|||
maxDepth := -1 // '-1' representing no maximum depth
|
||||
maxDepthStr := req.URL.Query().Get("max_depth")
|
||||
if maxDepthStr != "" {
|
||||
maybeMaxDepth, err := strconv.Atoi(maxDepthStr)
|
||||
var maybeMaxDepth int
|
||||
maybeMaxDepth, err = strconv.Atoi(maxDepthStr)
|
||||
if err != nil || maybeMaxDepth < 0 {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
|
|
|
|||
|
|
@ -574,7 +574,7 @@ func (s RoomSet) Add(val spec.RoomID) {
|
|||
|
||||
func (s RoomSet) Copy() RoomSet {
|
||||
copied := make(RoomSet, len(s))
|
||||
for k, _ := range s {
|
||||
for k := range s {
|
||||
copied.Add(k)
|
||||
}
|
||||
return copied
|
||||
|
|
|
|||
Loading…
Reference in a new issue