Re: remove duplicate code and not needed break statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jul 18, 2010 at 7:49 PM, Ralf Thielow
<ralf.thielow@xxxxxxxxxxxxxx> wrote:
> Remove duplicate code and not needed break statement.
>
> On switch statements you can use multiple cases for one
> statement and on a goto statement you not need a break.
>
> From 5b3e7c8f8b81a295b5c58534be250f5a818ccc64 Mon Sep 17 00:00:00 2001
> From: Ralf Thielow <ralf.thielow@xxxxxxxxxxxxxx>
> Date: Sun, 18 Jul 2010 18:48:58 +0200
> Subject: [PATCH] remove duplicate code and not needed break statement
>
> ---
>  server-info.c |    3 ---
>  1 files changed, 0 insertions(+), 3 deletions(-)
>
> diff --git a/server-info.c b/server-info.c
> index 4098ca2..9ec744e 100644
> --- a/server-info.c
> +++ b/server-info.c
> @@ -113,11 +113,8 @@ static int read_pack_info_file(const char *infofile)
>                                goto out_stale;
>                        break;
>                case 'D': /* we used to emit D but that was misguided. */
> -                       goto out_stale;
> -                       break;
>                case 'T': /* we used to emit T but nobody uses it. */

We have a tendency of adding a comment pointing out fall through
between case-statements. Perhaps you should add one? 'git grep -i
fall.\\?through' shows you some of the places we've got it now...

-- 
Erik "kusma" Faye-Lund
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]