Procházet zdrojové kódy

perf(fetcher): pre-allocate the cipherSuites

jvoisin před 11 měsíci
rodič
revize
af15032145
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      internal/reader/fetcher/request_builder.go

+ 1 - 1
internal/reader/fetcher/request_builder.go

@@ -130,7 +130,7 @@ func (r *RequestBuilder) ExecuteRequest(requestURL string) (*http.Response, erro
 		// and the insecure ones if we are ignoring TLS errors. This allows to connect to badly configured servers anyway
 		ciphers = append(ciphers, tls.InsecureCipherSuites()...)
 	}
-	cipherSuites := []uint16{}
+	cipherSuites := make([]uint16, 0, len(ciphers))
 	for _, cipher := range ciphers {
 		cipherSuites = append(cipherSuites, cipher.ID)
 	}