]> O.S.I.I.S - jp/vkvg.git/commitdiff
Substitute nested ifs with a single bigger if 63/head
authorMarco Rubin <20150305+Rubo3@users.noreply.github.com>
Mon, 24 Jan 2022 12:40:22 +0000 (12:40 +0000)
committerGitHub <noreply@github.com>
Mon, 24 Jan 2022 12:40:22 +0000 (12:40 +0000)
tests/common/vkengine.c

index 5dcb232945ce99b46f5fddddca4ffe6e3f489fa3..bc0deae116aaa0096717ff624d07d5590bd5f1e5 100644 (file)
@@ -176,10 +176,10 @@ vk_engine_t* vkengine_create (VkPhysicalDeviceType preferedGPU, VkPresentModeKHR
        VkhPhyInfo* phys = vkh_app_get_phyinfos (e->app, &phyCount, surf);
 
        VkhPhyInfo pi = 0;
-       if (!vkengine_try_get_phyinfo(phys, phyCount, preferedGPU, &pi))
-               if (!vkengine_try_get_phyinfo(phys, phyCount, VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU, &pi))
-                       if (!vkengine_try_get_phyinfo(phys, phyCount, VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU, &pi))
-                               pi = phys[0];
+       if (!vkengine_try_get_phyinfo(phys, phyCount, preferedGPU, &pi)
+       &&  !vkengine_try_get_phyinfo(phys, phyCount, VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU, &pi)
+       &&  !vkengine_try_get_phyinfo(phys, phyCount, VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU, &pi))
+               pi = phys[0];
 
        if (pi) {
                e->memory_properties = pi->memProps;