Fix topological sort.

This commit is contained in:
Nigel Tao committed 2017-07-20 16:01:41 +10:00
1 parent adadb0fd5a
commit 62811d440d
1 file changed
+4 -1
+4 -1
View File
@@ -33,8 +33,11 @@ func tssVisit(dst []*Struct, n *Struct, byName map[t.ID]*Struct, marks map[*Stru
temporary = 1
permanent = 2
)
if marks[n] == temporary {
switch marks[n] {
case temporary:
return nil, false
case permanent:
return dst, true
}
marks[n] = temporary