File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -89,18 +89,20 @@ def _hooks(self):
89
89
90
90
# Check if any of these make a longer double tailed diamond
91
91
found_diamond = False
92
- for ( mn , mx ) in [( i , j ) for i in potential_min for j in potential_max ] :
93
- if len ( H . neighbors_in (mx ) ) != 1 :
92
+ for mx in potential_max :
93
+ if H . in_degree (mx ) != 1 :
94
94
continue
95
- if len (H .all_paths (mn , mx )) == 2 :
96
- # Success
97
- min_elmt = mn
98
- max_elmt = mx
99
-
100
- min_diamond [mx ] = mn
101
- max_diamond [mn ] = mx
102
- diamond_index [mx ] = index
103
- found_diamond = True
95
+ for mn in potential_min :
96
+ if len (H .all_paths (mn , mx )) == 2 :
97
+ # Success
98
+ min_elmt = mn
99
+ max_elmt = mx
100
+ min_diamond [mx ] = mn
101
+ max_diamond [mn ] = mx
102
+ diamond_index [mx ] = index
103
+ found_diamond = True
104
+ break
105
+ if found_diamond :
104
106
break
105
107
if not found_diamond :
106
108
break
You can’t perform that action at this time.
0 commit comments