MCPcopy Create free account
hub / github.com/bobg/hashsplit / checkSplit

Method checkSplit

hashsplit.go:152–163  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

150}
151
152func (s *Splitter) checkSplit() (int, bool) {
153 splitBits := s.SplitBits
154 if splitBits == 0 {
155 splitBits = defaultSplitBits
156 }
157 h := s.rs.Sum32()
158 tz := bits.TrailingZeros32(h)
159 if tz >= splitBits {
160 return tz - splitBits, true
161 }
162 return 0, false
163}
164
165// Tree arranges a sequence of chunks produced by a Splitter into a "hashsplit tree."
166// The result is an iterator of TreeNode/level pairs in a particular order;

Callers 1

SplitMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected