Fix related section collapsing issue #145
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #142
Originally, the Uses table in the Related section would be collapsed and show 0 records even though there are actually some records existing. After the fix, if the amount of records <= 5, it would never be collapsed.
Reason for changing from min to max
The return value of
split_uses_by_frequent_funcs
isinfrequent_count
, and the purpose of the function is to Rearrange the results of get_uses() so that frequent functions are pushed to the bottom. I'm not 100% sure why we want to show infrequently used functions to users first here (maybe I misunderstood the real purpose of the function), but according to the function's goal and its doc comment, I'm thinking that we can change frommin
tomax
here so that we can show as many infrequently used functions to users as possible.Or if we still want it to show five records at most, we can specify the least records to show as well.
Perhaps: