Skip to content
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

Merged
merged 3 commits into from
Feb 22, 2019

Conversation

Yoric
Copy link
Collaborator

@Yoric Yoric commented Feb 19, 2019

General cleanup of ContentInfo.

@Yoric Yoric requested a review from arai-a February 19, 2019 15:46
@Yoric Yoric force-pushed the entropy-0.4-statistics-cleanup branch 3 times, most recently from 93a78c5 to b5b60d4 Compare February 19, 2019 16:08
string_literals: f("string_literals"),
list_lengths: f("list_lengths"),
}
macro_rules! do_loop { ($(($ident: ident, $name: expr, $bname: expr )),*) => {
Copy link
Collaborator

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?

Copy link
Collaborator Author

@Yoric Yoric Feb 19, 2019

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?

Copy link
Collaborator

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?

Copy link
Collaborator Author

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.
@Yoric Yoric force-pushed the entropy-0.4-statistics-cleanup branch 2 times, most recently from 6d43f5a to 1df6ed4 Compare February 20, 2019 08:43
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.
@Yoric Yoric force-pushed the entropy-0.4-statistics-cleanup branch from 1df6ed4 to ce6dcdd Compare February 20, 2019 08:47
@Yoric Yoric merged commit bca825f into binast:master Feb 22, 2019
@Yoric Yoric deleted the entropy-0.4-statistics-cleanup branch February 22, 2019 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants