riak-core-lite / riak_core_lite

Distributed systems infrastructure used by Riak.
Apache License 2.0
80 stars 13 forks source link

style: Clarify Node and NodeEntry vars in chash #110

Closed Raphexion closed 2 years ago

Raphexion commented 2 years ago

Related to this commit, there are three important types in the chash module.

-type chash_node() :: term(). -type chash() :: {num_partitions(), [node_entry()]}. -type node_entry() :: {index_as_int(), chash_node()}.

Because there are three distinct types and concepts, it is helpful if the variable names in the the source code reflects them. For example, so that we call a chash_node() for Node and a node_entry() for a NodeEntry.

I've updated the variable names to better reflect the type. And hopefully made the source code more readable.