change store.Push/Set(k, v) to store.Push/Set(v)
This commit is contained in:
@@ -10,17 +10,19 @@ func NewStore() *Store {
|
|||||||
return &store
|
return &store
|
||||||
}
|
}
|
||||||
|
|
||||||
func (store *Store) Push(k string, op Event) {
|
func (store *Store) Push(op Event) {
|
||||||
|
k := op.ID
|
||||||
event, ok := store.Get(k)
|
event, ok := store.Get(k)
|
||||||
if ok {
|
if ok {
|
||||||
event = event.Push(op)
|
event = event.Push(op)
|
||||||
} else {
|
} else {
|
||||||
event = op
|
event = op
|
||||||
}
|
}
|
||||||
store.Set(k, event)
|
store.Set(event)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (store *Store) Set(k string, v Event) {
|
func (store *Store) Set(v Event) {
|
||||||
|
k := v.ID
|
||||||
(*sync.Map)(store).Store(k, v)
|
(*sync.Map)(store).Store(k, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user