Re: remove duplicate code and not needed break statement
- From
Ralf Thielow <ralf.thielow@googlemail.com>
- Date
- Jul 18, 2010, 18:29 UTC
- Message-ID
- <AANLkTinrg2cp0XL0HOApGN25kmuL7xdik5aEo3lfRqz0@mail.gmail.com>
- In-Reply-To
- <AANLkTilhNLWEF-40hE9tWdJQX6FXpYWXCu7yhAC11Zvq@mail.gmail.com>
2010/7/18 Valeo de Vries <valeo@valeo.co.cc>:
Show 27 quoted lines
> On 18 July 2010 18:49, Ralf Thielow <ralf.thielow@googlemail.com> 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@googlemail.com> >> 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; > > You seem to have missed another, or am I just lacking context? ;) > > Valeo >
There were 2 cases on that switch statement which do the same thing. in case 'P' there is an if-statment before.
Ralf