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-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a94ea8ecb9fe6759f43ccafbb98bd3ec63c347e5;p=thirdparty%2Fapache%2Fhttpd.git 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/modules/ssl@90536 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/ssl_engine_io.c b/ssl_engine_io.c index a3f80b87d77..d6c0d34702c 100644 --- a/ssl_engine_io.c +++ b/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; }