From a202b87b3b1c1c73fc1a7a97d23814ba157d2181 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Fri, 5 Jun 2026 22:26:30 +0200 Subject: [PATCH] cleanup: drop redundant FirstChild nil-check in textHelper The `for c := n.FirstChild; c != nil; c = c.NextSibling` loop already handles the nil-FirstChild case. --- property.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/property.go b/property.go index 4231407..e59bcb7 100644 --- a/property.go +++ b/property.go @@ -71,10 +71,8 @@ func (s *Selection) textHelper(n *html.Node, builder *strings.Builder) { // Keep newlines and spaces, like jQuery builder.WriteString(n.Data) } - if n.FirstChild != nil { - for c := n.FirstChild; c != nil; c = c.NextSibling { - s.textHelper(c, builder) - } + for c := n.FirstChild; c != nil; c = c.NextSibling { + s.textHelper(c, builder) } }