0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-28 01:04:41 +08:00

for #41: minor beautifulize

This commit is contained in:
Sergey Yagovtsev 2017-06-05 13:11:02 +03:00
parent 39f0219ade
commit 1c5084c6de

View File

@ -553,14 +553,14 @@ extern "C" {
uint32_t read_number = 0; uint32_t read_number = 0;
::profiler::block_index_t blocks_counter = 0; ::profiler::block_index_t blocks_counter = 0;
::std::vector<char> name; ::std::vector<char> name;
const size_t thread_id_t_size = version < EASY_V_130 ? sizeof(uint32_t) : sizeof(::profiler::thread_id_t);
while (!inFile.eof() && read_number < total_blocks_number) while (!inFile.eof() && read_number < total_blocks_number)
{ {
EASY_BLOCK("Read thread data", ::profiler::colors::DarkGreen); EASY_BLOCK("Read thread data", ::profiler::colors::DarkGreen);
::profiler::thread_id_t thread_id = 0; ::profiler::thread_id_t thread_id = 0;
long thread_id_t_size = sizeof(decltype(thread_id));
if (version < EASY_V_130)
thread_id_t_size = sizeof(uint32_t);
inFile.read((char*)&thread_id, thread_id_t_size); inFile.read((char*)&thread_id, thread_id_t_size);
auto& root = threaded_trees[thread_id]; auto& root = threaded_trees[thread_id];