change store.Push/Set(k, v) to store.Push/Set(v)
parent
0399e10d7d
commit
27ea083084
|
|
@ -10,17 +10,19 @@ func NewStore() *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)
|
||||
if ok {
|
||||
event = event.Push(op)
|
||||
} else {
|
||||
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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue