1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 03:27:58 +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:
Peter Rajnoha 2015-02-27 14:52:31 +01:00
parent ee4cd2c737
commit 379fb90b05

View File

@ -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);