Skip to content

Commit

Permalink
Use references in for loops
Browse files Browse the repository at this point in the history
  • Loading branch information
SaschaWillems committed Dec 30, 2023
1 parent d0211d1 commit 9b52fb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/vulkanexamplebase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ VkResult VulkanExampleBase::createInstance(bool enableValidation)
std::vector<VkExtensionProperties> extensions(extCount);
if (vkEnumerateInstanceExtensionProperties(nullptr, &extCount, &extensions.front()) == VK_SUCCESS)
{
for (VkExtensionProperties extension : extensions)
for (VkExtensionProperties& extension : extensions)
{
supportedInstanceExtensions.push_back(extension.extensionName);
}
Expand Down Expand Up @@ -129,7 +129,7 @@ VkResult VulkanExampleBase::createInstance(bool enableValidation)
std::vector<VkLayerProperties> instanceLayerProperties(instanceLayerCount);
vkEnumerateInstanceLayerProperties(&instanceLayerCount, instanceLayerProperties.data());
bool validationLayerPresent = false;
for (VkLayerProperties layer : instanceLayerProperties) {
for (VkLayerProperties& layer : instanceLayerProperties) {
if (strcmp(layer.layerName, validationLayerName) == 0) {
validationLayerPresent = true;
break;
Expand Down

0 comments on commit 9b52fb7

Please sign in to comment.