From 0f7975cb351158d3b2245b4262761a698c6c5d7b Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 12 Apr 2016 11:46:41 +0200 Subject: [PATCH] cleanup: avoid declaring var in the middle of code Easier to read code. --- lib/device/dev-cache.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c index 6abb6a7f7..b5f215281 100644 --- a/lib/device/dev-cache.c +++ b/lib/device/dev-cache.c @@ -904,11 +904,11 @@ int dev_cache_index_devs(void) } else if (!sysfs_has_dev_block) return 1; - int with_udev = obtain_device_list_from_udev() && - udev_get_library_context(); + if (obtain_device_list_from_udev() && + udev_get_library_context()) + return _dev_cache_iterate_devs_for_index(); /* with udev */ - return with_udev ? _dev_cache_iterate_devs_for_index() - : _dev_cache_iterate_sysfs_for_index(path); + return _dev_cache_iterate_sysfs_for_index(path); } #ifdef UDEV_SYNC_SUPPORT