diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2015-02-27 14:52:31 +0100 |
---|---|---|
committer | Peter Rajnoha <prajnoha@redhat.com> | 2015-02-27 14:52:38 +0100 |
commit | 379fb90b05b9fae0559fb697981198d8bb58e0f9 (patch) | |
tree | ade12e2d9d08f01192ab013c63a49d0df1df4f5b | |
parent | ee4cd2c73774feeef3794c24865add1c28adb946 (diff) | |
download | lvm2-379fb90b05b9fae0559fb697981198d8bb58e0f9.tar.gz |
cleanup: change check order in condition in _check_pv_list fn
"!dev_cache_get(argv[i], cmd->full_filter) && !rescan_done" --> "!rescan_done && !dev_cache_get(argv[i], cmd->full_filter)
Check the simple condition first (variable), then the function return value
(which in this case certainly takes more time to evaluate) - save some time.
-rw-r--r-- | tools/reporter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/reporter.c b/tools/reporter.c index 0e563ac64..9bf366e10 100644 --- a/tools/reporter.c +++ b/tools/reporter.c @@ -578,7 +578,7 @@ static void _check_pv_list(struct cmd_context *cmd, int argc, char **argv, if (args_are_pvs && argc) { for (i = 0; i < argc; i++) { - if (!dev_cache_get(argv[i], cmd->full_filter) && !rescan_done) { + if (!rescan_done && !dev_cache_get(argv[i], cmd->full_filter)) { cmd->filter->wipe(cmd->filter); /* FIXME scan only one device */ lvmcache_label_scan(cmd, 0); |