From 6a5e4d8a6079231b6ef7072112c7b86ed7fb015f Mon Sep 17 00:00:00 2001 From: Eric Eaton Date: Wed, 9 Jul 2025 12:36:36 -0700 Subject: [PATCH] Use assert intead of a condition --- public/client/TracyRocprof.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/public/client/TracyRocprof.cpp b/public/client/TracyRocprof.cpp index 13bb7009..adbf30dc 100644 --- a/public/client/TracyRocprof.cpp +++ b/public/client/TracyRocprof.cpp @@ -247,14 +247,10 @@ void record_callback( rocprofiler_dispatch_counting_service_data_t dispatch_data uint16_t query_id = 0; { auto _lk = std::unique_lock{ data->mut }; - if( data->dispatch_query_id.count( dispatch_data.dispatch_info.dispatch_id ) ) - { - query_id = data->dispatch_query_id[dispatch_data.dispatch_info.dispatch_id]; - } - else - { - fprintf( stderr, "oops\n" ); - } + // An assumption is made here that the counter values are supplied after the dispatch + // complete callback. + assert( data->dispatch_query_id.count( dispatch_data.dispatch_info.dispatch_id ) ); + query_id = data->dispatch_query_id[dispatch_data.dispatch_info.dispatch_id]; } for( auto& p : sums )