From 6e71d3fbde344c26f8301dbd9550a110d5bc7ac4 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 17 Nov 2015 13:15:39 +0100 Subject: [PATCH] cleanup: more readable code Simplify if() expression. Rename 'this' to 'vg'.. --- lib/cache/lvmetad.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c index d300d3920..dced80a14 100644 --- a/lib/cache/lvmetad.c +++ b/lib/cache/lvmetad.c @@ -1187,16 +1187,17 @@ struct _lvmetad_pvscan_baton { static int _lvmetad_pvscan_single(struct metadata_area *mda, void *baton) { struct _lvmetad_pvscan_baton *b = baton; - struct volume_group *this; + struct volume_group *vg; - if (!(this = mda_is_ignored(mda) ? NULL : mda->ops->vg_read(b->fid, "", mda, NULL, NULL, 1))) + if (mda_is_ignored(mda) || + !(vg = mda->ops->vg_read(b->fid, "", mda, NULL, NULL, 1))) return 1; /* FIXME Also ensure contents match etc. */ - if (!b->vg || this->seqno > b->vg->seqno) - b->vg = this; + if (!b->vg || vg->seqno > b->vg->seqno) + b->vg = vg; else if (b->vg) - release_vg(this); + release_vg(vg); return 1; }