MCPcopy Create free account
hub / github.com/SolarLune/masterplan / ForEachInHead

Method ForEachInHead

stack.go:204–219  ·  view source on GitHub ↗
(f func(c *Card) bool)

Source from the content-addressed store, hash-verified

202}
203
204func (s *Stack) ForEachInHead(f func(c *Card) bool) {
205
206 above := s.Above
207 tested := map[*Card]bool{}
208 for above != nil {
209 if !f(above) {
210 return
211 }
212 if _, exists := tested[above]; exists {
213 break
214 }
215 tested[above] = true
216 above = above.Stack.Above
217 }
218
219}
220
221func (stack *Stack) Parent() *Card {
222 var parent *Card

Callers 1

ParentMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected