Skip to content

Conversation

@lorentey
Copy link
Member

This is reviving #116, eliminating all but the actual method implementations.

I still very much doubt that these will ever be used in actual practice, but I'm weary of asking for demonstrable use cases, so I'd much rather close the book on this PR and move on to working on documenting and/or benchmarking this data structure.

Cc @CTMacUser

Checklist

  • I've read the Contribution Guidelines
  • My contributions are licensed under the Swift license.
  • I've followed the coding style of the rest of the project.
  • I've added tests covering all new code paths my change adds to the project (if appropriate).
  • I've added benchmarks covering new functionality (if appropriate).
  • I've verified that my change does not break any existing tests or introduce unexplained benchmark regressions.
  • I've updated the documentation if necessary.

CTMacUser and others added 11 commits October 7, 2021 22:47
AFAIK, the previous code had no tests for itself, so the revised code doesn't either.
Remove the initializer's own unit tests, assuming that it will always work instead.
If the format of the incoming data does not match that of a heap, a precondition error is flagged instead.
We do not need a _raw initializer in the Heap implementation. The
heapify algorithm will not modify storage if it’s already in the
expected shape, so we can simply define one locally that double checks
that the order remains unchanged.
@lorentey
Copy link
Member Author

@swift-ci test

@lorentey lorentey merged commit 5a712f4 into apple:main Oct 12, 2022
@lorentey lorentey deleted the heap-replace-min-max branch October 13, 2022 23:58
@lorentey lorentey added this to the 1.1.0 milestone Oct 14, 2022
@lorentey lorentey added the Heap Min-max heap module label Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Heap Min-max heap module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants