ipld/unixfs/hamt: Encapsulate and document maxpadlen
logic
#388
Labels
help wanted
Seeking public contribution on this issue
status/deferred
Conscious decision to pause or backlog
Background: #387.
To differentiate between nodes of the HAMT directory and nodes that represent an entry in that directory (but that don't belong to it) the links in the DAG layer are being overloaded with hash information of the trie, that is, the link name is being prefixed like
AFname
(<hash-part><actual-link-name>
); so the reader stumbles upon comparisons likelen(lnk.Name) == ds.maxpadlen
when trying to figure out if this links points to a node of the HAMT directory or a entry node (a value of the in the trie leaf). I don't think this can be changed at this moment since it would be a major API breakage, but the next best thing would be to extract every reference ofmaxpadlen
(and related) to functions that clearly and explicitly tell the reader "we are checking if this link points to a node inside or outside the HAMT directory" and "we want to extract the actual name of the link embedded inlnk.Name
attribute".The text was updated successfully, but these errors were encountered: