From cf3bf4378bbcd554069915cfac47d242e664caa4 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 17 Jul 2018 23:13:56 +0200 Subject: [PATCH] No need to return MemEvent ptr from DrawAddress(). --- server/TracyView.cpp | 8 +++----- server/TracyView.hpp | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 09c9f60d..d968f042 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -3101,7 +3101,6 @@ void View::DrawZoneInfoWindow() ListMemData( v.begin(), v.end(), []( auto& v ) { ImGui::Text( "0x%" PRIx64, (*v)->ptr ); - return *v; } ); ImGui::TreePop(); } @@ -5243,7 +5242,7 @@ void View::DrawMemoryAllocWindow() } template -void View::ListMemData( T ptr, T end, std::function DrawAddress, const char* id ) +void View::ListMemData( T ptr, T end, std::function DrawAddress, const char* id ) { const auto& style = ImGui::GetStyle(); const auto dist = std::distance( ptr, end ) + 1; @@ -5316,7 +5315,8 @@ void View::ListMemData( T ptr, T end, std::function DrawAdd int idx = 0; while( ptr != end ) { - auto v = DrawAddress( ptr ); + auto v = *ptr; + DrawAddress( ptr ); if( ImGui::IsItemClicked() ) { m_memoryAllocInfoWindow = std::distance( mem.data.begin(), v ); @@ -5588,7 +5588,6 @@ void View::DrawMemory() { ImGui::Text( "0x%" PRIx64 "+%" PRIu64, v->ptr, m_memInfo.ptrFind - v->ptr ); } - return v; }, "##allocations" ); } } @@ -5629,7 +5628,6 @@ void View::DrawMemory() ListMemData( items.begin(), items.end(), []( auto& v ) { ImGui::Text( "0x%" PRIx64, (*v)->ptr ); - return *v; }, "##activeMem" ); ImGui::TreePop(); } diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 9350b94f..1572d964 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -85,7 +85,7 @@ private: void DrawMemoryAllocWindow(); template - void ListMemData( T ptr, T end, std::function DrawAddress, const char* id = nullptr ); + void ListMemData( T ptr, T end, std::function DrawAddress, const char* id = nullptr ); void DrawInfoWindow(); void DrawZoneInfoWindow();