mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
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.
This commit is contained in:
parent
ee4cd2c737
commit
379fb90b05
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user