X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/39c935d6d5ee86d153f6f7e6a10d723ae7c57f6f..c972ddd5a74b83c183357f707e7dfba87d48e750:/src/kernel/resource/profile/Profile.cpp diff --git a/src/kernel/resource/profile/Profile.cpp b/src/kernel/resource/profile/Profile.cpp index 234e2eb009..b6167c491d 100644 --- a/src/kernel/resource/profile/Profile.cpp +++ b/src/kernel/resource/profile/Profile.cpp @@ -129,7 +129,7 @@ Profile* Profile::from_string(const std::string& name, const std::string& input, std::vector splittedval((std::istream_iterator(iss)), std::istream_iterator()); - xbt_assert(splittedval.size() > 0, "Invalid profile line"); + xbt_assert(not splittedval.empty(), "Invalid profile line"); if (splittedval[0] == "DET") { stochevent.date_law = Distribution::DET; @@ -181,8 +181,8 @@ Profile* Profile::from_string(const std::string& name, const std::string& input, profile->stochastic_event_list.emplace_back(stochevent); } else { - XBT_ATTRIB_UNUSED int res = sscanf(val.c_str(), "%lg %lg\n", &event.date_, &event.value_); - xbt_assert(res == 2, "%s:%d: Syntax error in trace\n%s", name.c_str(), linecount, input.c_str()); + xbt_assert(sscanf(val.c_str(), "%lg %lg\n", &event.date_, &event.value_) == 2, + "%s:%d: Syntax error in trace\n%s", name.c_str(), linecount, input.c_str()); xbt_assert(last_event->date_ <= event.date_, "%s:%d: Invalid trace: Events must be sorted, but time %g > time %g.\n%s", name.c_str(), linecount,