Merge "Change bpdoc to separate entries with the same type"

This commit is contained in:
Trevor Radcliffe 2021-11-05 16:11:23 +00:00 committed by Gerrit Code Review
commit 0bf636f3ef

View file

@ -81,7 +81,6 @@ func AllPackages(pkgFiles map[string][]string, moduleTypeNameFactories map[strin
removeEmptyPropertyStructs(mtInfo) removeEmptyPropertyStructs(mtInfo)
collapseDuplicatePropertyStructs(mtInfo) collapseDuplicatePropertyStructs(mtInfo)
collapseNestedPropertyStructs(mtInfo) collapseNestedPropertyStructs(mtInfo)
combineDuplicateProperties(mtInfo)
// Add the ModuleInfo to the corresponding Package map/slice entries. // Add the ModuleInfo to the corresponding Package map/slice entries.
pkg := pkgMap[mtInfo.PkgPath] pkg := pkgMap[mtInfo.PkgPath]
@ -336,28 +335,3 @@ func collapseNestedProperties(p *[]Property) {
} }
*p = n *p = n
} }
func combineDuplicateProperties(mt *ModuleType) {
for _, ps := range mt.PropertyStructs {
combineDuplicateSubProperties(&ps.Properties)
}
}
func combineDuplicateSubProperties(p *[]Property) {
var n []Property
propertyLoop:
for _, child := range *p {
if len(child.Properties) > 0 {
combineDuplicateSubProperties(&child.Properties)
for i := range n {
s := &n[i]
if s.SameSubProperties(child) {
s.OtherNames = append(s.OtherNames, child.Name)
continue propertyLoop
}
}
}
n = append(n, child)
}
*p = n
}