httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject Re: cvs commit: httpd-2.0/server core.c
Date Mon, 26 Nov 2001 18:47:43 GMT
On 26 Nov 2001 brianp@apache.org wrote:

>   +                            for (next = APR_BRIGADE_FIRST(temp_brig);
>   +                                 next != APR_BRIGADE_SENTINEL(temp_brig);
>   +                                 next = APR_BRIGADE_FIRST(temp_brig)) {
>   +                                APR_BUCKET_REMOVE(next);
>   +                                APR_BUCKET_INSERT_AFTER(temp, next);
>   +                                temp = next;
>   +                            }
>   +                            apr_brigade_destroy(temp_brig);

You can do this in constant time, no for loop, with the brigade/ring
macros.  Normally you'd just use APR_BRIGADE_CONCAT, but that's assuming
temp is the last bucket in its brigade (is that the case? I'll have to
check).  If that's not the case, then you can do a splice or something
else, but in any case you don't need a for loop.  I'll take a closer look
at this and post a patch in a little while.

--Cliff


--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA



Mime
View raw message