Skip to content

Commit

Permalink
Merge pull request gocolly#246 from nigelbabu/fix-index-for-each-with…
Browse files Browse the repository at this point in the history
…-brk

Increment i before return True
  • Loading branch information
asciimoo authored Oct 28, 2018
2 parents 1e256b4 + f5bb885 commit 8be5ab8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion htmlelement.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ func (h *HTMLElement) ForEachWithBreak(goquerySelector string, callback func(int
h.DOM.Find(goquerySelector).EachWithBreak(func(_ int, s *goquery.Selection) bool {
for _, n := range s.Nodes {
if callback(i, NewHTMLElementFromSelectionNode(h.Response, s, n, i)) {
i++
return true
}
i++
}
return false
})
Expand Down

0 comments on commit 8be5ab8

Please sign in to comment.