Skip to content

Commit 96b9efb

Browse files
committed
Minor simplification
1 parent cc99b70 commit 96b9efb

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

go/pkg/pass1/set-zone.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ func (o *owner) isNil() bool { return o == nil }
807807
func (o *owner) equal(o2 routerAttr) bool { return o == o2 }
808808
func (o *owner) toRouter(r *router) { r.owner = o }
809809

810-
// inheritAttributesFromArea distributes area attributes to zones and
810+
// inheritAttributesFromArea distributes attributes of area to
811811
// managed routers.
812812
func (c *spoc) inheritAttributesFromArea() {
813813

@@ -842,14 +842,13 @@ func (c *spoc) inheritRouterAttributes(
842842
}
843843
// Check for redundant attribute with enclosing areas.
844844
for up := a.inArea; up != nil; up = up.inArea {
845-
if rA2 := &up.routerAttributes; rA2 != nil {
846-
if at2 := getAttr(rA2); !at2.isNil() {
847-
if at1.equal(at2) {
848-
c.warn("Useless '%s' at %s,\n"+
849-
" it was already inherited from %s",
850-
at1.attrName(), a.vxName(), rA2.name)
851-
return
852-
}
845+
rA2 := &up.routerAttributes
846+
if at2 := getAttr(rA2); !at2.isNil() {
847+
if at1.equal(at2) {
848+
c.warn("Useless '%s' at %s,\n"+
849+
" it was already inherited from %s",
850+
at1.attrName(), a.vxName(), rA2.name)
851+
return
853852
}
854853
}
855854
}

0 commit comments

Comments
 (0)