jira-importer opened a new issue, #1509:
URL: https://github.com/apache/httpcomponents-core/issues/1509

   **[Sebastiano 
Vigna](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=vigna)** 
opened 
**[HTTPCORE-361](https://issues.apache.org/jira/browse/HTTPCORE-361?redirect=false)**
 and commented
   
   The current implementation of getFirstHeader()
   
       public Header getFirstHeader(final String name) {
           for (final Header header : headers) {
               if (header.getName().equalsIgnoreCase(name)) {
                   return header;
               }
           }
           return null;
       }
   
   uses a Java syntax that creates an iterator object for eac hcall. We are 
seeing a lot of those in heap dumps. The getLastHeader() method uses a loop and 
has no such problems.
   
   We realize that it is slightly less elegant, but it would be great if you 
could change this method into
   
       public Header getFirstHeader(final String name) {
           final int size = headers.size();
           for (int i = 0; i < size; i++) {
               final Header header = headers.get(i);
               if (header.getName().equalsIgnoreCase(name)) {
                   return header;
               }
           }
       
           return null;
   
   }
   
   
   ---
   
   **Affects:** 4.3
   
   **Remote Links:**
   - [GitHub Pull Request `#217`
   ](https://github.com/apache/jmeter/pull/217)
   


-- 
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