Also freeze Heap types

This commit is contained in:
Karoy Lorentey committed 2021-08-30 15:31:25 -07:00
1 parent 0e9e7f13e4
commit 837a273bef
2 files changed
+3

No files matched your search

@@ -12,6 +12,7 @@
extension Heap {
/// A view of a `Heap`'s elements, as a `Sequence` from the smallest to
/// largest element.
@frozen
public struct AscendingView: Sequence, IteratorProtocol {
@usableFromInline
internal var _base: Heap
@@ -30,6 +31,7 @@ extension Heap {
/// A view of a `Heap`'s elements, as a `Sequence` from the largest to
/// smallest element.
@frozen
public struct DescendingView: Sequence, IteratorProtocol {
@usableFromInline
internal var _base: Heap
+1
View File
@@ -23,6 +23,7 @@
/// "Min-Max Heaps and Generalized Priority Queues."
/// *Communications of the ACM*, vol. 29, no. 10, Oct. 1986., pp. 996-1000,
/// doi:[10.1145/6617.6621](https://doi.org/10.1145/6617.6621)
@frozen
public struct Heap<Element: Comparable> {
@usableFromInline
internal var _storage: ContiguousArray<Element>