Переглянути джерело

perf(fetcher): pre-allocate the cipherSuites

jvoisin 9 місяців тому
батько
коміт
af15032145
1 змінених файлів з 1 додано та 1 видалено
  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)
 	}