Skip to content

refactor: remove unused findChild method from node - #1534

Open
lxcxjxhx wants to merge 1 commit into
cloudwego:mainfrom
lxcxjxhx:refactor/remove-findChild
Open

refactor: remove unused findChild method from node#1534
lxcxjxhx wants to merge 1 commit into
cloudwego:mainfrom
lxcxjxhx:refactor/remove-findChild

Conversation

@lxcxjxhx

Copy link
Copy Markdown

What

Remove the findChild method from node and replace its 3 call sites with findChildWithLabel.

Why

findChild is a strict subset of findChildWithLabel — it only searches children, while findChildWithLabel also checks paramChild and anyChild. All 3 call sites search for '/' or other non-param/any characters, so the behavior is identical. Keeping both methods adds confusion without benefit.

Changes

  • tree.go: delete findChild method (8 lines)
  • tree.go: replace 3 findChild calls with findChildWithLabel

Testing

go test ./pkg/route/...

All existing tests pass. This is a pure refactor with no behavior change.

Closes #1504

@CLAassistant

CLAassistant commented Aug 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Question: Can previous.kind == akind be reached in backtrackToNextNodeKind()?

2 participants