X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4de2a148bea34f550b79c07fb5e80ac36e6aa0e9..c6d6e5b87aed9c7080c981b11f91f2d0205623c3:/examples/cpp/io-degradation/s4u-io-degradation.cpp diff --git a/examples/cpp/io-degradation/s4u-io-degradation.cpp b/examples/cpp/io-degradation/s4u-io-degradation.cpp index f2c3e1853c..9ab897a285 100644 --- a/examples/cpp/io-degradation/s4u-io-degradation.cpp +++ b/examples/cpp/io-degradation/s4u-io-degradation.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017-2022. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2017-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -88,11 +88,9 @@ static double ssd_dynamic_sharing(const sg4::Disk* /*disk*/, const std::string& {15, 239.}}}}; const auto& data = SSD_SPEED.at(op); + const auto value = data.find(n); /* no special bandwidth for this disk sharing N flows, just returns maximal capacity */ - if (data.find(n) != data.end()) - capacity = data.at(n); - - return capacity; + return value == data.end() ? capacity : value->second; } /**