]> sourceware.org Git - lvm2.git/commitdiff
cleanup: check arg_count once
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 14 Jul 2014 15:34:49 +0000 (17:34 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Thu, 17 Jul 2014 14:18:35 +0000 (16:18 +0200)
Do not check quiet_ARG more then necessary.

tools/lvmcmdline.c

index be7844b3311dc605b066e214d4a7252f359a491e..ccef904a2aabbbe5a8519343c02b47679817d294 100644 (file)
@@ -935,11 +935,9 @@ static int _get_settings(struct cmd_context *cmd)
        if (arg_count(cmd, quiet_ARG)) {
                cmd->current_settings.debug = 0;
                cmd->current_settings.verbose = 0;
+               cmd->current_settings.silent = (arg_count(cmd, quiet_ARG) > 1) ? 1 : 0;
        }
 
-       if (arg_count(cmd, quiet_ARG) > 1)
-               cmd->current_settings.silent = 1;
-
        if (arg_count(cmd, test_ARG))
                cmd->current_settings.test = arg_count(cmd, test_ARG);
 
This page took 0.042 seconds and 5 git commands to generate.