mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-03-13 09:50:19 +08:00
Fix some warnings from LGTM (#2420)
* fix assignment of a variable to itself * Fix unnecessary 'else' clause in loop * formatting and redundant reasignment fix * mark unreachable code with a TODO comment * fix variable defined multiple times * fix static method without static decorator * revert unintended autoformatting Co-authored-by: Christian Clauss <cclauss@me.com> * revert autoformatting issue * applied black autoformatting Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
@@ -226,6 +226,7 @@ class DirectedGraph:
|
||||
break
|
||||
else:
|
||||
return True
|
||||
# TODO:The following code is unreachable.
|
||||
anticipating_nodes.add(stack[len_stack_minus_one])
|
||||
len_stack_minus_one -= 1
|
||||
if visited.count(node[1]) < 1:
|
||||
@@ -453,6 +454,8 @@ class Graph:
|
||||
break
|
||||
else:
|
||||
return True
|
||||
# TODO: the following code is unreachable
|
||||
# is this meant to be called in the else ?
|
||||
anticipating_nodes.add(stack[len_stack_minus_one])
|
||||
len_stack_minus_one -= 1
|
||||
if visited.count(node[1]) < 1:
|
||||
|
||||
@@ -146,6 +146,7 @@ class Graph:
|
||||
self.parent[root2] = root1
|
||||
return root1
|
||||
|
||||
@staticmethod
|
||||
def boruvka_mst(graph):
|
||||
"""
|
||||
Implementation of Boruvka's algorithm
|
||||
|
||||
Reference in New Issue
Block a user