From f6b68b4c4b7eeed27da05d555cc5757c79feb753 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 22 Jun 2021 11:24:27 +0100 Subject: [PATCH] Simplify --- federationapi/routing/send.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index 36f98f31..66fc7f03 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -483,14 +483,12 @@ func (t *txnReq) getServers(ctx context.Context, roomID string, eventOrigin goma return t.servers } dedupe := map[gomatrixserverlib.ServerName]struct{}{} - count := 1 t.servers = []gomatrixserverlib.ServerName{t.Origin} // transaction origin dedupe[t.Origin] = struct{}{} if eventOrigin != "" { if _, ok := dedupe[eventOrigin]; !ok { t.servers = append(t.servers, eventOrigin) // event origin, if specified dedupe[eventOrigin] = struct{}{} - count++ } } serverReq := &api.QueryServerJoinedToRoomRequest{ @@ -502,8 +500,7 @@ func (t *txnReq) getServers(ctx context.Context, roomID string, eventOrigin goma if _, ok := dedupe[server]; !ok { t.servers = append(t.servers, server) dedupe[server] = struct{}{} - count++ - if count == 10 { + if len(t.servers) == 10 { break } }