From 585bfeda127dbea2a25a0ccf7ec2f6aac124a323 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Wed, 7 Nov 2018 10:09:41 +0000 Subject: [PATCH] Improve comments on the BFS loop block --- .../matrix-org/dendrite/roomserver/query/query.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/roomserver/query/query.go b/src/github.com/matrix-org/dendrite/roomserver/query/query.go index 1ce131a9a..390fe71d8 100644 --- a/src/github.com/matrix-org/dendrite/roomserver/query/query.go +++ b/src/github.com/matrix-org/dendrite/roomserver/query/query.go @@ -500,9 +500,9 @@ func (r *RoomserverQueryAPI) scanEventTree( resultNIDs = make([]types.EventNID, 0, limit) - // Loop through the event IDs to retrieve the related events and go through - // the whole tree (up to the provided limit) using the events' "prev_event" - // key. + // Loop through the event IDs to retrieve the requested events and go + // through the whole tree (up to the provided limit) using the events' + // "prev_event" key. BFSLoop: for len(front) > 0 { var next []string @@ -539,6 +539,7 @@ BFSLoop: } } } + // Repeat the same process with the parent events we just processed. front = next }