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.
This commit is contained in:
jvoisin
2026-06-05 22:26:30 +02:00
parent 88920eaad4
commit a202b87b3b
+2 -4
View File
@@ -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)
}
}