Update returns a Vector with the index for the specific ID incremented by one. If it is possible, the vector v is updated and returned. If it is not, a copy will be created, updated and returned.
(id ShortID)
| 120 | // one. If it is possible, the vector v is updated and returned. If it is not, |
| 121 | // a copy will be created, updated and returned. |
| 122 | func (v Vector) Update(id ShortID) Vector { |
| 123 | now := uint64(time.Now().Unix()) |
| 124 | return v.updateWithNow(id, now) |
| 125 | } |
| 126 | |
| 127 | func (v Vector) updateWithNow(id ShortID, now uint64) Vector { |
| 128 | for i := range v.Counters { |