]> AND Public Git Repository - simgrid.git/blobdiff - src/kernel/resource/profile/FutureEvtSet.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Misc code simplifications guided by Sonar smells.
[simgrid.git] / src / kernel / resource / profile / FutureEvtSet.cpp
index f4d494ab04024cb8c49d9eea03db81efa0486943..d693df2ba5e91a339ba72456d009153e9b00b58f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2022. 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. */
@@ -37,8 +37,7 @@ double FutureEvtSet::next_date() const
 /** @brief Retrieves the next occurring event, or nullptr if none happens before date */
 Event* FutureEvtSet::pop_leq(double date, double* value, resource::Resource** resource)
 {
-  double event_date = next_date();
-  if (event_date > date || heap_.empty())
+  if (next_date() > date || heap_.empty())
     return nullptr;
 
   Event* event       = heap_.top().second;