From: Cliff Woolley Date: Thu, 23 Aug 2001 02:32:26 +0000 (+0000) Subject: performance: change an O(n) while loop to an equivalent O(1) brigade macro X-Git-Tag: 2.0.25~159 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=051e111a798e58c2f41eab9d7559552c810a9315;p=apache performance: change an O(n) while loop to an equivalent O(1) brigade macro git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90536 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/ssl/ssl_engine_io.c b/modules/ssl/ssl_engine_io.c index a3f80b87d7..d6c0d34702 100644 --- a/modules/ssl/ssl_engine_io.c +++ b/modules/ssl/ssl_engine_io.c @@ -372,8 +372,10 @@ static apr_status_t ssl_io_filter_Output(ap_filter_t *f, return ret; } -static apr_status_t ssl_io_filter_Input(ap_filter_t *f,apr_bucket_brigade *pbbOut, - ap_input_mode_t eMode, apr_off_t *readbytes) +static apr_status_t ssl_io_filter_Input(ap_filter_t *f, + apr_bucket_brigade *pbbOut, + ap_input_mode_t eMode, + apr_off_t *readbytes) { apr_status_t ret; SSLFilterRec *pRec = f->ctx; @@ -388,12 +390,7 @@ static apr_status_t ssl_io_filter_Input(ap_filter_t *f,apr_bucket_brigade *pbbOu if (ret != APR_SUCCESS) return ret; - /* XXX: shame that APR_BRIGADE_FOREACH doesn't work here */ - while(!APR_BRIGADE_EMPTY(pRec->pbbPendingInput)) { - apr_bucket *pbktIn=APR_BRIGADE_FIRST(pRec->pbbPendingInput); - APR_BUCKET_REMOVE(pbktIn); - APR_BRIGADE_INSERT_TAIL(pbbOut,pbktIn); - } + APR_BRIGADE_CONCAT(pbbOut, pRec->pbbPendingInput); return APR_SUCCESS; }