Skip to content

Generator should not mutate the PriorityQueue #1

@adipascu

Description

@adipascu

extension PriorityQueue: GeneratorType { public typealias Element = T public func next() -> Element? { return pop() } }

Just iterating the elements causes the PriorityQueue to be cleared out.
If you use any of the swift functions that iterate over SequenceType, functions like contains() the queue also gets cleared.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions