Rename duplicateStateKeys to findDuplicateStateKeys

This commit is contained in:
Mark Haines 2017-02-14 13:42:14 +00:00
parent 7fc31eee66
commit bed16c0808

View file

@ -137,7 +137,7 @@ func calculateAndStoreStateMany(db RoomEventDatabase, roomNID types.RoomNID, pre
combined = combined[:unique(stateEntrySorter(combined))] combined = combined[:unique(stateEntrySorter(combined))]
// Find the conflicts // Find the conflicts
conflicts := duplicateStateKeys(combined) conflicts := findDuplicateStateKeys(combined)
var state []types.StateEntry var state []types.StateEntry
if len(conflicts) > 0 { if len(conflicts) > 0 {
@ -162,7 +162,7 @@ func resolveConflicts(db RoomEventDatabase, combined, conflicted []types.StateEn
panic(fmt.Errorf("Not implemented")) panic(fmt.Errorf("Not implemented"))
} }
func duplicateStateKeys(a []types.StateEntry) []types.StateEntry { func findDuplicateStateKeys(a []types.StateEntry) []types.StateEntry {
var result []types.StateEntry var result []types.StateEntry
j := 0 j := 0
for i := 1; i < len(a); i++ { for i := 1; i < len(a); i++ {