Skip to content

Minimum queue removal logic is wrong #1462

Open
@buydrpepper

Description

@buydrpepper

Under (method 2):
if (!q.empty() && q.front().second == cnt_removed)
q.pop_front();
cnt_removed++;

Correct me if I'm wrong, but this should either not include the empty check at all, or increment cnt_removed only if the queue is nonempty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions