DupMappedAtt creates a deep copy of ma.
(ma *MappedAttributeExpr)
| 85 | |
| 86 | // DupMappedAtt creates a deep copy of ma. |
| 87 | func DupMappedAtt(ma *MappedAttributeExpr) *MappedAttributeExpr { |
| 88 | nameMap := make(map[string]string, len(ma.nameMap)) |
| 89 | reverseMap := make(map[string]string, len(ma.reverseMap)) |
| 90 | maps.Copy(nameMap, ma.nameMap) |
| 91 | maps.Copy(reverseMap, ma.reverseMap) |
| 92 | return &MappedAttributeExpr{ |
| 93 | AttributeExpr: DupAtt(ma.AttributeExpr), |
| 94 | nameMap: nameMap, |
| 95 | reverseMap: reverseMap, |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | // WalkMappedAttr iterates over the mapped attributes. It calls the given |
| 100 | // function giving each attribute as it iterates. WalkMappedAttr stops if there |
no test coverage detected