diff options
author | Sami Kerola | 2016-07-04 23:12:55 +0200 |
---|---|---|
committer | Sami Kerola | 2016-07-21 22:14:33 +0200 |
commit | 92a4d098ce12994756c3a0527786609a83947224 (patch) | |
tree | bb48c64753a377d2cfc353ddb7a71b0b54eabb96 /libblkid/src/probe.c | |
parent | lslogins: simplify if clause and move definition and comments [oclint] (diff) | |
download | kernel-qcow2-util-linux-92a4d098ce12994756c3a0527786609a83947224.tar.gz kernel-qcow2-util-linux-92a4d098ce12994756c3a0527786609a83947224.tar.xz kernel-qcow2-util-linux-92a4d098ce12994756c3a0527786609a83947224.zip |
libblkid: simplify if clause [oclint]
Move negative and positive testing of 'has' variable to top level, and test
flag bit mask on second level. This way the 'has' needs to be checked only
once.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'libblkid/src/probe.c')
-rw-r--r-- | libblkid/src/probe.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c index d7a3ba7cf..43ea4c741 100644 --- a/libblkid/src/probe.c +++ b/libblkid/src/probe.c @@ -552,13 +552,11 @@ int __blkid_probe_filter_types(blkid_probe pr, int chain, int flag, char *names[ break; } } - if (flag & BLKID_FLTR_ONLYIN) { - if (!has) + if (has) { + if (flag & BLKID_FLTR_NOTIN) blkid_bmp_set_item(fltr, i); - } else if (flag & BLKID_FLTR_NOTIN) { - if (has) - blkid_bmp_set_item(fltr, i); - } + } else if (flag & BLKID_FLTR_ONLYIN) + blkid_bmp_set_item(fltr, i); } DBG(LOWPROBE, ul_debug("%s: a new probing type-filter initialized", |