mirror of
https://github.com/PuerkitoBio/goquery.git
synced 2024-04-21 12:31:36 +00:00
Removed unnecessary if
IsMatcher returns false if len(s.Nodes) !> 0, so Is was double checking if len(s.Nodes) > 0
This commit is contained in:
@@ -5,11 +5,7 @@ import "golang.org/x/net/html"
|
|||||||
// Is checks the current matched set of elements against a selector and
|
// Is checks the current matched set of elements against a selector and
|
||||||
// returns true if at least one of these elements matches.
|
// returns true if at least one of these elements matches.
|
||||||
func (s *Selection) Is(selector string) bool {
|
func (s *Selection) Is(selector string) bool {
|
||||||
if len(s.Nodes) > 0 {
|
return s.IsMatcher(compileMatcher(selector))
|
||||||
return s.IsMatcher(compileMatcher(selector))
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsMatcher checks the current matched set of elements against a matcher and
|
// IsMatcher checks the current matched set of elements against a matcher and
|
||||||
|
|||||||
Reference in New Issue
Block a user