MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / forEachLeaf

Method forEachLeaf

db/revtree.go:330–341  ·  view source on GitHub ↗
(callback func(*RevInfo))

Source from the content-addressed store, hash-verified

328}
329
330func (tree RevTree) forEachLeaf(callback func(*RevInfo)) {
331 isParent := map[string]bool{}
332 for _, info := range tree {
333 isParent[info.Parent] = true
334 }
335 for revid, info := range tree {
336 if !isParent[revid] {
337 callback(info)
338
339 }
340 }
341}
342
343func (tree RevTree) isLeaf(revid string) bool {
344 if !tree.contains(revid) {

Callers 10

RepairCyclesMethod · 0.95
LeavesMethod · 0.95
winningRevisionMethod · 0.95
RenderGraphvizDotMethod · 0.95
LongestBranchMethod · 0.95
getResyncedDocumentMethod · 0.80
TestRevTreeForEachLeafFunction · 0.80
RevDiffMethod · 0.80

Calls

no outgoing calls

Tested by 3

LongestBranchMethod · 0.76
TestRevTreeForEachLeafFunction · 0.64