From 1fe07fab459083ae79843ff72faf8c84549311b4 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Thu, 9 Mar 2017 11:45:37 +0000 Subject: [PATCH] Comments on why the array has one element --- src/github.com/matrix-org/dendrite/roomserver/state/state.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/github.com/matrix-org/dendrite/roomserver/state/state.go b/src/github.com/matrix-org/dendrite/roomserver/state/state.go index 092e5821a..5fde6ae25 100644 --- a/src/github.com/matrix-org/dendrite/roomserver/state/state.go +++ b/src/github.com/matrix-org/dendrite/roomserver/state/state.go @@ -40,6 +40,7 @@ func LoadStateAtSnapshot(db RoomStateDatabase, stateNID types.StateSnapshotNID) if err != nil { return nil, err } + // We've asked for exactly one snapshot from the db so we should have exactly one entry in the result. stateBlockNIDList := stateBlockNIDLists[0] stateEntryLists, err := db.StateEntries(stateBlockNIDList.StateBlockNIDs) @@ -258,6 +259,7 @@ func loadStateAtSnapshotForNumericTuples( if err != nil { return nil, err } + // We've asked for exactly one snapshot from the db so we should have exactly one entry in the result. stateBlockNIDList := stateBlockNIDLists[0] stateEntryLists, err := db.StateEntriesForTuples(stateBlockNIDList.StateBlockNIDs, stateKeyTuples)