Skip to content

Commit

Permalink
Use one less unnecessary defer
Browse files Browse the repository at this point in the history
  • Loading branch information
jdoe7865623 authored and arriven committed Mar 4, 2022
1 parent 48e2370 commit 6e94229
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,14 @@ func (c *BasicJobConfig) Next(ctx context.Context) bool {
return false
default:
}
if c.Count > 0 {
defer func() { c.iter++ }()
return c.iter < c.Count

if c.Count <= 0 {
return true
}
return true

c.iter++

return c.iter <= c.Count
}

func getProxylist() (urls []string) {
Expand Down Expand Up @@ -247,7 +250,7 @@ func httpJob(ctx context.Context, l *logs.Logger, args JobArgs) error {
}
}

var client = &http.Client{
client := &http.Client{
Transport: &http.Transport{
TLSClientConfig: tlsConfig,
Dial: (&net.Dialer{
Expand Down

0 comments on commit 6e94229

Please sign in to comment.