-
Notifications
You must be signed in to change notification settings - Fork 79
constify C stats api #939
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
constify C stats api #939
Conversation
|
📖 Docs for this PR can be previewed here |
fd8d5a6 to
c63e796
Compare
Codecov Report
@@ Coverage Diff @@
## main #939 +/- ##
=======================================
Coverage 93.40% 93.40%
=======================================
Files 25 25
Lines 20335 20335
Branches 824 824
=======================================
Hits 18994 18994
Misses 1304 1304
Partials 37 37
Continue to review full report at Codecov.
|
|
Thanks @castedo - would you mind marking these as "draft" PRs until they're ready for review/merging? It's tricky for me to keep track of what's what and know what GitHub updates I should pay attention to. |
c63e796 to
2709305
Compare
|
Roughly speaking, this PR just constifies all the stats functions in trees.h/c. Because this PR still does not change the types in trees.h, some stats functions can not yet be constified (e.g. tsk_treeseq_kc_distance). That happens in the next and final PR #940 . Two functions have const params that are fun, e.g. This is a fun case where "Mediterranean/romance" noun-adjective order is the only way to express what stays constant. It might be intuitive reading it "in Spanish", e.g. "tsk_id_t puntero constante puntero" where the const is an adjective to the noun to the left, not to the right. Heads up there's a non-stats tweak: because the tables are copied. |
jeromekelleher
left a comment
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.
This is excellent @castedo, a major improvement in documenting this rather tricky API. Some minor comments and questions.
2709305 to
5052b05
Compare
|
LGTM for merging. |
jeromekelleher
left a comment
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.
Let's merge!
5052b05 to
fdcabbf
Compare
For #844. This builds on top of #920 which did not constify all the "stats" functions in tree.h.
This PR constifies all those stats functions and fixes duplicated typedefs by keeping them defined only once in trees.h.