递归消除特殊元素
This commit is contained in:
parent
e3509b4023
commit
5629f5439b
@ -1125,13 +1125,19 @@ func (this *MapData) SpecialElem(id int, s int32) (x map[int]struct{}) {
|
||||
}
|
||||
}
|
||||
|
||||
// for k := range x {
|
||||
// if this.Plat[k].Special != 0 {
|
||||
// for key := range this.SpecialElem(k, this.Plat[k].Special) { // 递归调用
|
||||
// x[key] = struct{}{}
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
for k := range x {
|
||||
if k == id {
|
||||
continue
|
||||
}
|
||||
sp := this.Plat[k].Special
|
||||
if sp != 0 {
|
||||
this.Plat[k].Special = 0
|
||||
ids := this.SpecialElem(k, sp) // 递归调用
|
||||
for key := range ids {
|
||||
x[key] = struct{}{}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user