-
Notifications
You must be signed in to change notification settings - Fork 33
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
Entropy 0.4 statistics cleanup #312
Conversation
93a78c5
to
b5b60d4
Compare
crates/binjs_io/src/io/statistics.rs
Outdated
string_literals: f("string_literals"), | ||
list_lengths: f("list_lengths"), | ||
} | ||
macro_rules! do_loop { ($(($ident: ident, $name: expr, $bname: expr )),*) => { |
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.
why is this named do_loop
? (I don't think this is a loop...)
can this (and others) be renamed to something more descriptive?
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.
How would you call them?
generate_foo
, generate_bar
, etc?
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 seeing each changeset, so the name should be changed accordingly in the later changeset)
given the outer macro is called for_field_in_content_info
(maybe the outer macro should be called for_each_field_in_content_info
), this macro should be named what it does for each field.
so, for this case, what this does is generate ContentInfo
field, and the value is the result of calling function.
simple one would be just generate_field
.
to be more descriptive, how about generate_field_with_function_call
or something?
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've kept a generic name, but I've added comments for each macro definition.
Replacing lots of copy paste of strings with a few macros.
6d43f5a
to
1df6ed4
Compare
While `ContentInfo` was initially design to gather statistics on contents, its main use is now to contain user-extensible data. This patch: - removes the fields that are not associated to user-extensible data; - renames ContentInfo to UserExtensible. Also, some of the statistics-gathering that took place during compression, and that used the now removed fields, has been deactivated. Since we're not using it, it's not really useful to keep at hand.
1df6ed4
to
ce6dcdd
Compare
General cleanup of
ContentInfo
.