Skip to content

Commit a14bed8

Browse files
committed
mark unreachable code with a TODO comment
1 parent ad7977a commit a14bed8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

graphs/directed_and_undirected_(weighted)_graph.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ def has_cycle(self):
226226
break
227227
else:
228228
return True
229-
anticipating_nodes.add(stack[len_stack_minus_one])
229+
# TODO:The following code is unreachable.
230+
anticipating_nodes.add(
231+
stack[len_stack_minus_one])
230232
len_stack_minus_one -= 1
231233
if visited.count(node[1]) < 1:
232234
stack.append(node[1])
@@ -453,7 +455,10 @@ def has_cycle(self):
453455
break
454456
else:
455457
return True
456-
anticipating_nodes.add(stack[len_stack_minus_one])
458+
# TODO: the following code is unreachable
459+
# is this meant to be called in the else ?
460+
anticipating_nodes.add(
461+
stack[len_stack_minus_one])
457462
len_stack_minus_one -= 1
458463
if visited.count(node[1]) < 1:
459464
stack.append(node[1])

0 commit comments

Comments
 (0)