mirror of
https://github.com/PuerkitoBio/goquery.git
synced 2026-10-19 16:15:33 +00:00
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:
+2
-4
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user