File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -831,20 +831,13 @@ func (c *Collector) checkFilters(URL, domain string) error {
831831}
832832
833833func (c * Collector ) isDomainAllowed (domain string ) bool {
834- for _ , d2 := range c .DisallowedDomains {
835- if d2 == domain {
836- return false
837- }
834+ if slices .Contains (c .DisallowedDomains , domain ) {
835+ return false
838836 }
839837 if c .AllowedDomains == nil || len (c .AllowedDomains ) == 0 {
840838 return true
841839 }
842- for _ , d2 := range c .AllowedDomains {
843- if d2 == domain {
844- return true
845- }
846- }
847- return false
840+ return slices .Contains (c .AllowedDomains , domain )
848841}
849842
850843func (c * Collector ) checkRobots (u * url.URL ) error {
@@ -1422,7 +1415,7 @@ func (c *Collector) Clone() *Collector {
14221415 AllowedDomains : c .AllowedDomains ,
14231416 AllowURLRevisit : c .AllowURLRevisit ,
14241417 CacheDir : c .CacheDir ,
1425- CacheExpiration : c .CacheExpiration ,
1418+ CacheExpiration : c .CacheExpiration ,
14261419 DetectCharset : c .DetectCharset ,
14271420 DisallowedDomains : c .DisallowedDomains ,
14281421 ID : atomic .AddUint32 (& collectorCounter , 1 ),
You can’t perform that action at this time.
0 commit comments