add comment about tree traversal

This commit is contained in:
Pat Moroney 2018-01-12 11:36:29 -07:00
parent 4f138c4f92
commit 100279cd16

View File

@ -136,6 +136,8 @@ func InitPathMaps(files []*descriptor.FileDescriptorProto) {
}
}
// addToPathMap traverses through the AST adding SourceCodeInfo_Location entries to the pathMap.
// Since the AST is a tree, the recursion finishes once it has gone through all the nodes.
func addToPathMap(info *descriptor.SourceCodeInfo, i interface{}, path []int32) {
loc := findLoc(info, path)
if loc != nil {