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

Method addDescendent

sizes/sizes.go:43–57  ·  view source on GitHub ↗
(filename string, s2 TreeSize)

Source from the content-addressed store, hash-verified

41}
42
43func (s *TreeSize) addDescendent(filename string, s2 TreeSize) {
44 s.MaxPathDepth.AdjustMaxIfNecessary(s2.MaxPathDepth.Plus(1))
45 if s2.MaxPathLength > 0 {
46 s.MaxPathLength.AdjustMaxIfNecessary(
47 (counts.NewCount32(uint64(len(filename))) + 1).Plus(s2.MaxPathLength),
48 )
49 } else {
50 s.MaxPathLength.AdjustMaxIfNecessary(counts.NewCount32(uint64(len(filename))))
51 }
52 s.ExpandedTreeCount.Increment(s2.ExpandedTreeCount)
53 s.ExpandedBlobCount.Increment(s2.ExpandedBlobCount)
54 s.ExpandedBlobSize.Increment(s2.ExpandedBlobSize)
55 s.ExpandedLinkCount.Increment(s2.ExpandedLinkCount)
56 s.ExpandedSubmoduleCount.Increment(s2.ExpandedSubmoduleCount)
57}
58
59// Record that the object has a blob of the specified `size` as a
60// direct descendant.

Callers 1

initializeMethod · 0.80

Calls 4

NewCount32Function · 0.92
AdjustMaxIfNecessaryMethod · 0.45
PlusMethod · 0.45
IncrementMethod · 0.45

Tested by

no test coverage detected