You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rainer Jung <ra...@kippdata.de> on 2014/01/09 20:17:22 UTC
Re: svn commit: r1556914 - /httpd/httpd/trunk/modules/dav/lock/locks.c
On 09.01.2014 19:48, jailletc36@apache.org wrote:
> Author: jailletc36
> Date: Thu Jan 9 18:48:11 2014
> New Revision: 1556914
>
> URL: http://svn.apache.org/r1556914
> Log:
> Add missing break in 'dav_generic_do_refresh' to avoid useless computation.
>
> Modified:
> httpd/httpd/trunk/modules/dav/lock/locks.c
>
> Modified: httpd/httpd/trunk/modules/dav/lock/locks.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/dav/lock/locks.c?rev=1556914&r1=1556913&r2=1556914&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/dav/lock/locks.c (original)
> +++ httpd/httpd/trunk/modules/dav/lock/locks.c Thu Jan 9 18:48:11 2014
> @@ -1093,6 +1093,7 @@ static int dav_generic_do_refresh(dav_lo
> {
> dp->f.timeout = new_time;
> dirty = 1;
> + break;
> }
> }
Here and in r1556911: you could also drop the variable dirty, return 1
instead of break and return 0 after the loop.
Regards,
Rainer
Re: svn commit: r1556914 - /httpd/httpd/trunk/modules/dav/lock/locks.c
Posted by Marion & Christophe JAILLET <ch...@wanadoo.fr>.
Sure,
but I personally prefer to keep only one exit point in functions.
Just a matter of taste.
CJ
Le 09/01/2014 20:17, Rainer Jung a écrit :
> On 09.01.2014 19:48, jailletc36@apache.org wrote:
>> Author: jailletc36
>> Date: Thu Jan 9 18:48:11 2014
>> New Revision: 1556914
>>
>> URL: http://svn.apache.org/r1556914
>> Log:
>> Add missing break in 'dav_generic_do_refresh' to avoid useless computation.
>>
>> Modified:
>> httpd/httpd/trunk/modules/dav/lock/locks.c
>>
>> Modified: httpd/httpd/trunk/modules/dav/lock/locks.c
>> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/dav/lock/locks.c?rev=1556914&r1=1556913&r2=1556914&view=diff
>> ==============================================================================
>> --- httpd/httpd/trunk/modules/dav/lock/locks.c (original)
>> +++ httpd/httpd/trunk/modules/dav/lock/locks.c Thu Jan 9 18:48:11 2014
>> @@ -1093,6 +1093,7 @@ static int dav_generic_do_refresh(dav_lo
>> {
>> dp->f.timeout = new_time;
>> dirty = 1;
>> + break;
>> }
>> }
> Here and in r1556911: you could also drop the variable dirty, return 1
> instead of break and return 0 after the loop.
>
> Regards,
>
> Rainer
>
>