ok2c commented on code in PR #751:
URL: 
https://github.com/apache/httpcomponents-core/pull/751#discussion_r4640886140


##########
httpcore5/src/main/java/org/apache/hc/core5/http/impl/DefaultConnectionReuseStrategy.java:
##########
@@ -85,6 +85,12 @@ public boolean keepAlive(
             if (request.containsHeader(HttpHeaders.CONTENT_LENGTH) && 
request.containsHeader(HttpHeaders.TRANSFER_ENCODING)) {

Review Comment:
   @rootvector2 Let's optimize it  a bit and execute CONTENT_LENGTH and 
TRANSFER_ENCODING checks only once
   
   ```
   final boolean contentLenPresent = 
request.containsHeader(HttpHeaders.CONTENT_LENGTH);
   final boolean transferEncodingPresent = 
request.containsHeader(HttpHeaders.TRANSFER_ENCODING);
    if (contentLenPresent && transferEncodingPresent) {
   ...
   ```
   



##########
httpcore5/src/main/java/org/apache/hc/core5/http/impl/DefaultConnectionReuseStrategy.java:
##########
@@ -85,6 +85,12 @@ public boolean keepAlive(
             if (request.containsHeader(HttpHeaders.CONTENT_LENGTH) && 
request.containsHeader(HttpHeaders.TRANSFER_ENCODING)) {

Review Comment:
   @rootvector2 Let's optimize it  a bit and execute CONTENT_LENGTH and 
TRANSFER_ENCODING checks only once
   
   ```
   final boolean contentLenPresent = 
request.containsHeader(HttpHeaders.CONTENT_LENGTH);
   final boolean transferEncodingPresent = 
request.containsHeader(HttpHeaders.TRANSFER_ENCODING);
   if (contentLenPresent && transferEncodingPresent) {
   ...
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to