MCPcopy
hub / github.com/github/git-sizer / Plus

Method Plus

counts/counts.go:77–84  ·  view source on GitHub ↗

Plus returns the sum of two Count64s, capped at math.MaxUint64.

(n2 Count64)

Source from the content-addressed store, hash-verified

75
76// Plus returns the sum of two Count64s, capped at math.MaxUint64.
77func (n1 Count64) Plus(n2 Count64) Count64 {
78 n := n1 + n2
79 if n < n1 {
80 // Overflow
81 return math.MaxUint64
82 }
83 return n
84}
85
86// Increment increases `*n1` by `n2`, capped at math.MaxUint64.
87func (n1 *Count64) Increment(n2 Count64) {

Callers 1

IncrementMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected