diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2020-11-16 15:44:53 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-16 15:44:53 +0000 |
commit | 20a01bceb2869c810932eac217d96dc221953685 (patch) | |
tree | 639cd8656282ae231a46531f063d7d010320a582 /cmd/resolve-state | |
parent | d8b526b603683879c012972707cdce44fff3c802 (diff) |
Pass pointers to events — reloaded (#1583)
* Pass events as pointers
* Fix lint errors
* Update gomatrixserverlib
* Update gomatrixserverlib
* Update to matrix-org/gomatrixserverlib#240
Diffstat (limited to 'cmd/resolve-state')
-rw-r--r-- | cmd/resolve-state/main.go | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/cmd/resolve-state/main.go b/cmd/resolve-state/main.go index 9fb14f05..a622fbf2 100644 --- a/cmd/resolve-state/main.go +++ b/cmd/resolve-state/main.go @@ -80,9 +80,9 @@ func main() { } authEventIDMap := make(map[string]struct{}) - eventPtrs := make([]*gomatrixserverlib.Event, len(eventEntries)) + events := make([]*gomatrixserverlib.Event, len(eventEntries)) for i := range eventEntries { - eventPtrs[i] = &eventEntries[i].Event + events[i] = eventEntries[i].Event for _, authEventID := range eventEntries[i].AuthEventIDs() { authEventIDMap[authEventID] = struct{}{} } @@ -99,18 +99,9 @@ func main() { panic(err) } - authEventPtrs := make([]*gomatrixserverlib.Event, len(authEventEntries)) + authEvents := make([]*gomatrixserverlib.Event, len(authEventEntries)) for i := range authEventEntries { - authEventPtrs[i] = &authEventEntries[i].Event - } - - events := make([]gomatrixserverlib.Event, len(eventEntries)) - authEvents := make([]gomatrixserverlib.Event, len(authEventEntries)) - for i, ptr := range eventPtrs { - events[i] = *ptr - } - for i, ptr := range authEventPtrs { - authEvents[i] = *ptr + authEvents[i] = authEventEntries[i].Event } fmt.Println("Resolving state") |