Clean up a bit

This commit is contained in:
Neil Alexander 2021-04-16 14:01:37 +01:00
parent 8c2bb18697
commit b4d1ebf54a
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 0 additions and 26 deletions

View file

@ -130,31 +130,10 @@ func (d *Database) StateEntriesForTuples(
if err != nil {
return nil, fmt.Errorf("d.EventsTable.BulkSelectStateEventByNID: %w", err)
}
//if len(stateKeyTuples) == 0 {
lists = append(lists, types.StateEntryList{
StateBlockNID: stateBlockNIDs[i],
StateEntries: entries,
})
/*} else {
eventTypes := map[types.EventTypeNID]struct{}{}
stateKeys := map[types.EventStateKeyNID]struct{}{}
for _, t := range stateKeyTuples {
eventTypes[t.EventTypeNID] = struct{}{}
stateKeys[t.EventStateKeyNID] = struct{}{}
}
filteredEntries := []types.StateEntry{}
for _, entry := range entries {
_, tok := eventTypes[entry.EventTypeNID]
_, sok := stateKeys[entry.EventStateKeyNID]
if tok && sok {
filteredEntries = append(filteredEntries, entry)
}
}
lists = append(lists, types.StateEntryList{
StateBlockNID: stateBlockNIDs[i],
StateEntries: filteredEntries,
})
}*/
}
return lists, nil
}