Page MenuHomeSoftware Heritage

Make MerkleNode.collect return a set of MerkleNode instead of a dict
Closed, MigratedEdits Locked

Description

The MerkleNode.collect method enables to return the nodes in a Merkle tree that have been modified or added since the last collect operation.

However it currently returns a dict with the following layout:

{
  'node_type_A': {
    node1.hash: node1.get_data(),
    node2.hash: node2.get_data(),
  },
  'node_type_A': {
    node3.hash: node3.get_data(),
    ...
  },
  ...
}

It would be more convenient if that method simply returns the set of added/modified nodes since the last collect as it would give more flexibility to
client code for the processing of those nodes.