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

Function NewCount32

counts/counts.go:12–17  ·  view source on GitHub ↗

NewCount32 initializes a Count32 from a uint64, capped at math.MaxUint32.

(n uint64)

Source from the content-addressed store, hash-verified

10// NewCount32 initializes a Count32 from a uint64, capped at
11// math.MaxUint32.
12func NewCount32(n uint64) Count32 {
13 if n > math.MaxUint32 {
14 return Count32(math.MaxUint32)
15 }
16 return Count32(n)
17}
18
19// ToUint64 returns the value of `n` as a `uint64`. If the value has
20// overflowed, it returns `(math.MaxUint32, true)`.

Callers 13

TestMetricFunction · 0.92
TestBinaryFunction · 0.92
TestLimits32Function · 0.92
TestCount32Function · 0.92
addDescendentMethod · 0.92
addBlobMethod · 0.92
addLinkMethod · 0.92
addSubmoduleMethod · 0.92
RegisterCommitMethod · 0.92
SizeMethod · 0.92
ParseBatchHeaderFunction · 0.92
ParseTagFunction · 0.92

Calls 1

Count32TypeAlias · 0.85

Tested by 4

TestMetricFunction · 0.74
TestBinaryFunction · 0.74
TestLimits32Function · 0.74
TestCount32Function · 0.74