-
-
Notifications
You must be signed in to change notification settings - Fork 997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix some more typos #7750
base: RC_2_0
Are you sure you want to change the base?
Fix some more typos #7750
Conversation
90e6ada
to
8dcafd5
Compare
@@ -99,7 +99,7 @@ TORRENT_EXPORT void* session_create(int tag, ...) | |||
va_list lp; | |||
va_start(lp, tag); | |||
|
|||
fingerprint fing("LT", lt::version_major, lt::version_minor, lt::version_tiny, 0); | |||
fingerprint find("LT", lt::version_major, lt::version_minor, lt::version_tiny, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think fing
is supposed to refer to "fingerprint"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will exclude....(another thing to be added to exclusion list from my other PR)
int const num_leafs = merkle_num_leafs(num_pieces * blocks_per_piece); | ||
int const num_nodes = merkle_num_nodes(num_leafs); | ||
int const first_leaf = merkle_first_leaf(num_leafs); | ||
int const num_leaves = merkle_num_leaves(num_pieces * blocks_per_piece); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this change. "leaf" is a term of art in computer science. Perhaps mostly used as adjective to describe the leaf nodes. I hesitate to call them "leaves" as that implies actual leaves on actual trees (not the computer science data structure "tree").
They are currently (as far as I know) consistently referred to as "leafs". I kind of see the "node" as implied in that name. Perhaps this is a controversial perspective. I would rather rename these "leaf_nodes" over "leaves". But I also think the current acronym is quite reasonable.
I think the change is controversial mostly because it's already internally consistent, and a rename would have to make sure it's consistently renamed everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leaves
are already mentioned throughout some parts of code in repo:
https://github.com/search?q=repo%3Aarvidn%2Flibtorrent%20leaves&type=code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. so some decision has to be made then. do you think "leaves" is preferred over "lefs"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. so some decision has to be made then. do you think "leaves" is preferred over "lefs"?
I think changing to "leaves" would be ok, but it's up to you really.
https://en.wikipedia.org/wiki/Merkle_tree#Overview
A hash tree is a tree of hashes in which the leaves (i.e., leaf nodes, sometimes also called "leafs") are hashes of data blocks in, for instance, a file or set of files.
No description provided.