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

Better document the use of Heaps with Dynamic Array as Store #8677

Merged
merged 4 commits into from
Feb 9, 2023

Conversation

MathewColin
Copy link
Contributor

Fix issue 18333: binaryHeap documentation inadequately describes slice store invalidation

https://issues.dlang.org/show_bug.cgi?id=18333

    Fix issue 18333: binaryHeap documentation inadequately describes slice store invalidation
@dlang-bot
Copy link
Contributor

dlang-bot commented Feb 3, 2023

Thanks for your pull request and interest in making D better, @MathewColin! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
18333 normal binaryHeap documentation inadequately describes slice store invalidation

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + phobos#8677"

Fix issue 18333: binaryHeap documentation inadequately describes slice store invalidation
Copy link
Contributor

@dkorpel dkorpel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please move the new test after the normal example? It's confusing to start with examples of unusual behavior before examples of usual behavior.

int[] a = [ 4, 1, 3, 2, 16, 9, 10, 14, 8, 7 ];
auto h = heapify(a);

/* Internal representation of Binary Heap tree */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/* Internal representation of Binary Heap tree */
// Internal representation of Binary Heap tree

I suggest using the same comment style as the other example

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will move the example and also change the comment style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants