From 59296974c71dfc7db7d003b40af84fa36a5e93c6 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 2 Jan 2021 21:52:20 +0100 Subject: Avoid "else" after "return" --- examples/sybok.hpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'examples/sybok.hpp') diff --git a/examples/sybok.hpp b/examples/sybok.hpp index ed82afb..7740824 100644 --- a/examples/sybok.hpp +++ b/examples/sybok.hpp @@ -782,7 +782,9 @@ public: VkInstance h = {}; if (const VkResult r = vkCreateInstance(&createInfo, nullptr, &h)) { return r; - } else if (!h) { + } + + if (!h) { // Shouldn't actually happen, but this lets the compiler know that return VK_ERROR_INITIALIZATION_FAILED; } @@ -1392,7 +1394,9 @@ public: VkDeviceMemory h = {}; if (const VkResult r = vkAllocateMemory(device, &info, nullptr, &h)) { return r; - } else if (!h) { + } + + if (!h) { return VK_ERROR_OUT_OF_DEVICE_MEMORY; } @@ -1484,7 +1488,9 @@ public: if (const VkResult r = vkCreateDebugReportCallbackEXT(instance, &createInfo, nullptr, &h)) { return r; - } else if (!h) { + } + + if (!h) { return VK_ERROR_FEATURE_NOT_PRESENT; } @@ -1577,7 +1583,9 @@ public: if (r) { return r; - } else if (!h) { + } + + if (!h) { return VK_ERROR_INCOMPATIBLE_DRIVER; } @@ -1763,7 +1771,9 @@ private: { if (r) { return r; - } else if (!handle) { + } + + if (!handle) { return VK_ERROR_INITIALIZATION_FAILED; } -- cgit v1.2.1