hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r366930 - /jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/HeaderGroup.java
Date Sat, 07 Jan 2006 21:55:15 GMT
Author: olegk
Date: Sat Jan  7 13:55:04 2006
New Revision: 366930

URL: http://svn.apache.org/viewcvs?rev=366930&view=rev
Log:
Do not use iterator for better reasons

Modified:
    jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/HeaderGroup.java

Modified: jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/HeaderGroup.java
URL: http://svn.apache.org/viewcvs/jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/HeaderGroup.java?rev=366930&r1=366929&r2=366930&view=diff
==============================================================================
--- jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/HeaderGroup.java
(original)
+++ jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/HeaderGroup.java
Sat Jan  7 13:55:04 2006
@@ -141,8 +141,8 @@
     public Header[] getHeaders(String name) {
         ArrayList headersFound = new ArrayList();
         
-        for (Iterator headerIter = headers.iterator(); headerIter.hasNext();) {
-            Header header = (Header) headerIter.next();
+        for (int i = 0; i < headers.size(); i++) {
+            Header header = (Header) headers.get(i);
             if (header.getName().equalsIgnoreCase(name)) {
                 headersFound.add(header);
             }
@@ -209,8 +209,8 @@
      * contained, <code>false</code> otherwise
      */
     public boolean containsHeader(String name) {
-        for (Iterator headerIter = headers.iterator(); headerIter.hasNext();) {
-            Header header = (Header) headerIter.next();
+        for (int i = 0; i < headers.size(); i++) {
+            Header header = (Header) headers.get(i);
             if (header.getName().equalsIgnoreCase(name)) {
                 return true;
             }



Mime
View raw message