Skip to content

Commit

Permalink
Remove unused nodes list
Browse files Browse the repository at this point in the history
Signed-off-by: marinamoore <mnm678@gmail.com>
  • Loading branch information
mnm678 committed Sep 11, 2020
1 parent 68c4812 commit 28cc103
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tuf/repository_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,6 @@ def _build_merkle_tree(fileinfodict):
# We will build the merkle tree starting with the leaf nodes. Each
# leaf contains snapshot information for a single metadata file.
leaves = []
nodes = []
for name, contents in sorted(fileinfodict.items()):
if name.endswith(".json"):
name = os.path.splitext(name)[0]
Expand All @@ -1666,9 +1665,8 @@ def _build_merkle_tree(fileinfodict):
# Otherwise, use the next two nodes to build a new node.
else:
n = InternalNode(current_nodes[i], current_nodes[i+1])
# Add this node to the next level, and to a list of all nodes
# Add this node to the next level
new_nodes.append(n)
nodes.append(n)
current_nodes = new_nodes

# The only node remaining in current_nodes will be the root node.
Expand Down

0 comments on commit 28cc103

Please sign in to comment.