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

Method Plus

counts/counts.go:26–33  ·  view source on GitHub ↗

Plus returns the sum of two Count32s, capped at math.MaxUint32.

(n2 Count32)

Source from the content-addressed store, hash-verified

24
25// Plus returns the sum of two Count32s, capped at math.MaxUint32.
26func (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.
36func (n1 *Count32) Increment(n2 Count32) {

Callers 2

IncrementMethod · 0.95
addDescendentMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected