From 3855699cc0ce816ae3dd95b8aadbc7e25263b6a3 Mon Sep 17 00:00:00 2001 From: Noah Santschi-Cooney Date: Wed, 17 Jan 2018 13:49:09 +0000 Subject: [PATCH] Removed unnecessary if IsMatcher returns false if len(s.Nodes) !> 0, so Is was double checking if len(s.Nodes) > 0 --- query.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/query.go b/query.go index 1a7f873..fe86bf0 100644 --- a/query.go +++ b/query.go @@ -5,11 +5,7 @@ import "golang.org/x/net/html" // Is checks the current matched set of elements against a selector and // returns true if at least one of these elements matches. func (s *Selection) Is(selector string) bool { - if len(s.Nodes) > 0 { - return s.IsMatcher(compileMatcher(selector)) - } - - return false + return s.IsMatcher(compileMatcher(selector)) } // IsMatcher checks the current matched set of elements against a matcher and