Get value of key
(key uint64)
| 97 | |
| 98 | // Get value of key |
| 99 | func (this *Counter[T]) Get(key uint64) T { |
| 100 | var index = int(key % this.countMaps) |
| 101 | this.locker.RLock(index) |
| 102 | defer this.locker.RUnlock(index) |
| 103 | var item = this.itemMaps[index][key] |
| 104 | if item.IsOk() { |
| 105 | return item.Sum() |
| 106 | } |
| 107 | return 0 |
| 108 | } |
| 109 | |
| 110 | // GetKey get value of string key |
| 111 | func (this *Counter[T]) GetKey(key string) T { |