From f000dce73f0a66c773178df76dc96578c255898d Mon Sep 17 00:00:00 2001 From: Terence Rokop Date: Sat, 26 Jun 2021 08:30:15 -0700 Subject: [PATCH] Replace "enum class" switches with explicit casts --- server/TracyView.cpp | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 2c124f6b..858b9ac0 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -12277,32 +12277,9 @@ void View::AccumulationModeComboBox() ImGui::SameLine(); const char* accumulationModeTable = "Self only\0Including children\0Non-reentrant\0"; ImGui::SetNextItemWidth( ImGui::CalcTextSize( "Including children" ).x + ImGui::GetTextLineHeight() * 2 ); - int accumulationMode; - switch ( m_statAccumulationMode ) - { - case AccumulationMode::SelfOnly: - accumulationMode = 0; - break; - case AccumulationMode::AllChildren: - accumulationMode = 1; - break; - case AccumulationMode::NonReentrantChildren: - accumulationMode = 2; - break; - } + int accumulationMode = static_cast( m_statAccumulationMode ); ImGui::Combo( "##accumulationMode", &accumulationMode, accumulationModeTable ); - switch ( accumulationMode ) - { - case 0: - m_statAccumulationMode = AccumulationMode::SelfOnly; - break; - case 1: - m_statAccumulationMode = AccumulationMode::AllChildren; - break; - case 2: - m_statAccumulationMode = AccumulationMode::NonReentrantChildren; - break; - } + m_statAccumulationMode = static_cast( accumulationMode ); } void View::DrawStatistics()