From 1b61fc6cf7d95126589d894ccc367b1bf3dde4e0 Mon Sep 17 00:00:00 2001 From: asuessenbach Date: Thu, 17 Nov 2022 13:47:56 +0100 Subject: [PATCH] Use std::equal to compare array of null-terminated strings in structs. --- VulkanHppGenerator.cpp | 18 +++++-------- vulkan/vulkan_structs.hpp | 57 +++++++++++++-------------------------- 2 files changed, 25 insertions(+), 50 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 2f41c04..3d47e7f 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -533,9 +533,9 @@ void VulkanHppGenerator::addCommand( std::string const & name, CommandData & com std::map::iterator handleIt = m_handles.find( commandData.params[0].type.type ); if ( handleIt == m_handles.end() ) { - handleIt = m_handles.find( "" ); + handleIt = m_handles.begin(); + assert( handleIt->first == "" ); } - assert( handleIt != m_handles.end() ); commandData.handle = handleIt->first; // add this command to the list of commands @@ -9003,16 +9003,10 @@ std::string VulkanHppGenerator::generateStructCompareOperators( std::pair