merkle: Make MerkleNode.collect return a set of nodes instead of a dict
Previously the MerkleNode.collect method was returning a dict whose keys are node types and values dict of {<node_hash>: <node_data>}. In order to give more flexibility to client code for the processing of collected nodes, prefer to simply return a set of MerkleNode. As a consequence, MerkleNode objects need to be hashable by Python so the __hash__ method has also been implemented. Closes T4633
Showing
- swh/model/from_disk.py 1 addition, 1 deletionswh/model/from_disk.py
- swh/model/merkle.py 22 additions, 104 deletionsswh/model/merkle.py
- swh/model/tests/test_from_disk.py 34 additions, 27 deletionsswh/model/tests/test_from_disk.py
- swh/model/tests/test_merkle.py 22 additions, 27 deletionsswh/model/tests/test_merkle.py
Loading
Please register or sign in to comment