matchtree: Accurate comments for visit functions
Change-Id: Ib75fe072e7faf05ccd42acd563773351490ebeac
diff --git a/matchtree.go b/matchtree.go
index 441c81c..b9438ba 100644
--- a/matchtree.go
+++ b/matchtree.go
@@ -322,7 +322,8 @@
return fmt.Sprintf("branch(%x)", t.mask)
}
-// Visit the matchTree. Skips noVisitMatchTree
+// visitMatches visits all atoms in matchTree. Note: This visits
+// noVisitMatchTree. For collecting matches use visitMatches.
func visitMatchTree(t matchTree, f func(matchTree)) {
switch s := t.(type) {
case *andMatchTree:
@@ -342,6 +343,8 @@
}
}
+// visitMatches visits all atoms which can contribute matches. Note: This
+// skips noVisitMatchTree.
func visitMatches(t matchTree, known map[matchTree]bool, f func(matchTree)) {
switch s := t.(type) {
case *andMatchTree: