You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2006/01/08 15:02:42 UTC
svn commit: r367029 -
/jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/protocol/AbstractHttpProcessor.java
Author: olegk
Date: Sun Jan 8 06:02:30 2006
New Revision: 367029
URL: http://svn.apache.org/viewcvs?rev=367029&view=rev
Log:
Do not use iterator for performance and memory footprint reasons
Modified:
jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/protocol/AbstractHttpProcessor.java
Modified: jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/protocol/AbstractHttpProcessor.java
URL: http://svn.apache.org/viewcvs/jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/protocol/AbstractHttpProcessor.java?rev=367029&r1=367028&r2=367029&view=diff
==============================================================================
--- jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/protocol/AbstractHttpProcessor.java (original)
+++ jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/protocol/AbstractHttpProcessor.java Sun Jan 8 06:02:30 2006
@@ -135,8 +135,8 @@
protected void preprocessRequest(final HttpMutableRequest request)
throws IOException, HttpException {
if (this.requestInterceptors != null) {
- for (Iterator i = this.requestInterceptors.iterator(); i.hasNext(); ) {
- HttpRequestInterceptor interceptor = (HttpRequestInterceptor) i.next();
+ for (int i = 0; i < this.requestInterceptors.size(); i++) {
+ HttpRequestInterceptor interceptor = (HttpRequestInterceptor) this.requestInterceptors.get(i);
interceptor.process(request, this.localContext);
}
}
@@ -145,8 +145,8 @@
protected void postprocessResponse(final HttpMutableResponse response)
throws IOException, HttpException {
if (this.responseInterceptors != null) {
- for (Iterator i = this.responseInterceptors.iterator(); i.hasNext(); ) {
- HttpResponseInterceptor interceptor = (HttpResponseInterceptor) i.next();
+ for (int i = 0; i < this.responseInterceptors.size(); i++) {
+ HttpResponseInterceptor interceptor = (HttpResponseInterceptor) this.responseInterceptors.get(i);
interceptor.process(response, this.localContext);
}
}