From fc0da88de6139abfed41a8ee05a456be3520bcbe Mon Sep 17 00:00:00 2001 From: Blanco Alonso Jorge Date: Fri, 9 Oct 2020 19:02:23 +0200 Subject: [PATCH] Change min/max calcuations to one-liners --- src/report_reader.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/report_reader.cpp b/src/report_reader.cpp index 195b7f26..b54c11db 100644 --- a/src/report_reader.cpp +++ b/src/report_reader.cpp @@ -358,13 +358,10 @@ DataFrame ReportReader::Population::get(const nonstd::optional& if (it == nodes_pointers_.end()) { continue; } - if (it->second.first < min) { - min = it->second.first; - } - if (it->second.second > max) { - max = it->second.second; - } + min = std::min(it->second.first, min); + max = std::max(it->second.second, max); positions.emplace_back(it->second.first, it->second.second); + std::vector element_ids(it->second.second - it->second.first); dataset_elem_ids.select({it->second.first}, {it->second.second - it->second.first}) .read(element_ids.data());