Plus returns the sum of two Count32s, capped at math.MaxUint32.
(n2 Count32)
| 24 | |
| 25 | // Plus returns the sum of two Count32s, capped at math.MaxUint32. |
| 26 | func (n1 Count32) Plus(n2 Count32) Count32 { |
| 27 | n := n1 + n2 |
| 28 | if n < n1 { |
| 29 | // Overflow |
| 30 | return math.MaxUint32 |
| 31 | } |
| 32 | return n |
| 33 | } |
| 34 | |
| 35 | // Increment increases `*n1` by `n2`, capped at math.MaxUint32. |
| 36 | func (n1 *Count32) Increment(n2 Count32) { |
no outgoing calls
no test coverage detected