Skip to content

cleanup: factor getSiblingsNodes helper, rename for-Until variant#587

Open
jvoisin wants to merge 1 commit into
PuerkitoBio:masterfrom
jvoisin:nilnil
Open

cleanup: factor getSiblingsNodes helper, rename for-Until variant#587
jvoisin wants to merge 1 commit into
PuerkitoBio:masterfrom
jvoisin:nilnil

Conversation

@jvoisin

@jvoisin jvoisin commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Most callers of getSiblingNodes pass nil, nil for the trailing untilm/untilNodes args, the until criteria only apply to the Next/Prev *Until family. This commit splits the function in two:

  1. Rename getSiblingNodes -> getSiblingNodesUntil; the name now matches the parameter shape.
  2. getSiblingNodes(nodes, st) is now a helper that calls getSiblingNodesUntil(nodes, st, nil, nil).

It makes the code a bit more clear, as more than once I wondered what where the last two parameters from getSiblingNodes

Most callers of getSiblingNodes pass nil, nil for the trailing
untilm/untilNodes args, the until criteria only apply to the
Next/Prev *Until family. This commit splits the function in two:

1. Rename getSiblingNodes -> getSiblingNodesUntil; the name now matches the
   parameter shape.
2. getSiblingNodes(nodes, st) is now a helper that calls
   getSiblingNodesUntil(nodes, st, nil, nil).

It makes the code a bit more clear, as more than once I wondered what where the
last two parameters from getSiblingNodes
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