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

Remove localQueueIndex from QueuingAlgorithms #9396

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chencs
Copy link
Contributor

@chencs chencs commented Sep 24, 2024

What this PR does

With the introduction of leaf-node designations in #8871, we no longer need to maintain local queues on all nodes, and we can instead use isLeaf() to govern tree traversal decisions.

Note that this introduces a subtle difference to the round-robin child queue ordering (Node.queueOrder) because all enqueued children will be enqueued "behind" the current queueOrder[queuePosition] node instead of maintaining a special case. This does not change dequeue order, and is a no-op from the perspective of a caller to the tree.

Which issue(s) this PR fixes or relates to

Fixes #

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

This subtly changes queuing order, since queuing multiple new nodes at once will push the first element to the end of the queueOrder. However, it does NOT change dequeue order (which is what we care about), since it also updates queuePosition to continue pointing to that first-enqueued element.
@chencs chencs marked this pull request as ready for review September 24, 2024 23:14
@chencs chencs requested a review from a team as a code owner September 24, 2024 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant