[pacman-dev] [PATCH] Style: Removing unecessary indentation level.

Andrew Gregory andrew.gregory.8 at gmail.com
Sat Apr 6 18:08:17 UTC 2019

On 04/04/19 at 12:21am, Leonardo Bras wrote:
> Signed-off-by: Leonardo Bras <leobras.c at gmail.com>
> ---
>  src/pacman/sync.c | 84 ++++++++++++++++++++++++-----------------------
>  1 file changed, 43 insertions(+), 41 deletions(-)

I appreciate the reduction of indentation, but I think this does more harm than
good.  It breaks our official style rules because err is no longer declared at
the top of its block; it makes sync_prepare_execute inconsistent because the
trans_prepare error is still handled in an if block; finally, it makes the
error branch look like the primary execution branch instead of an exception.
I would move the error printing out of sync_prepare_execute altogether into
print_{prepare,commit}_error functions.  That will also have the benefit of
shortening sync_prepare_execute, which is a bit long.

More information about the pacman-dev mailing list