Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
inline a useless function
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 1 Apr 2018 09:07:13 +0000 (11:07 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 1 Apr 2018 09:07:13 +0000 (11:07 +0200)
include/simgrid/kernel/resource/Model.hpp
src/kernel/resource/Model.cpp
src/surf/cpu_interface.cpp
src/surf/cpu_ti.cpp
src/surf/network_cm02.cpp

index 1956833..e1faffb 100644 (file)
@@ -60,7 +60,6 @@ public:
 
   double actionHeapTopDate() const { return action_heap_.top().first; }
   Action* actionHeapPop();
 
   double actionHeapTopDate() const { return action_heap_.top().first; }
   Action* actionHeapPop();
-  bool actionHeapIsEmpty() const { return action_heap_.empty(); }
 
   /**
    * @brief Share the resources between the actions
 
   /**
    * @brief Share the resources between the actions
index 3eb402d..fab52e2 100644 (file)
@@ -100,7 +100,7 @@ double Model::next_occuring_event_lazy(double now)
   }
 
   // hereafter must have already the min value for this resource model
   }
 
   // hereafter must have already the min value for this resource model
-  if (not actionHeapIsEmpty()) {
+  if (not action_heap_.empty()) {
     double min = actionHeapTopDate() - now;
     XBT_DEBUG("minimum with the HEAP %f", min);
     return min;
     double min = actionHeapTopDate() - now;
     XBT_DEBUG("minimum with the HEAP %f", min);
     return min;
index 9747338..ceb797d 100644 (file)
@@ -22,7 +22,7 @@ namespace surf {
 
 void CpuModel::update_actions_state_lazy(double now, double /*delta*/)
 {
 
 void CpuModel::update_actions_state_lazy(double now, double /*delta*/)
 {
-  while (not actionHeapIsEmpty() && double_equals(actionHeapTopDate(), now, sg_surf_precision)) {
+  while (not get_action_heap().empty() && double_equals(actionHeapTopDate(), now, sg_surf_precision)) {
 
     CpuAction* action = static_cast<CpuAction*>(actionHeapPop());
     XBT_CDEBUG(surf_kernel, "Something happened to action %p", action);
 
     CpuAction* action = static_cast<CpuAction*>(actionHeapPop());
     XBT_CDEBUG(surf_kernel, "Something happened to action %p", action);
index a76da40..7df39bf 100644 (file)
@@ -332,7 +332,7 @@ double CpuTiModel::next_occuring_event(double now)
   }
 
   /* get the min next event if heap not empty */
   }
 
   /* get the min next event if heap not empty */
-  if (not actionHeapIsEmpty())
+  if (not get_action_heap().empty())
     min_action_duration = actionHeapTopDate() - now;
 
   XBT_DEBUG("Share resources, min next event date: %f", min_action_duration);
     min_action_duration = actionHeapTopDate() - now;
 
   XBT_DEBUG("Share resources, min next event date: %f", min_action_duration);
@@ -342,7 +342,7 @@ double CpuTiModel::next_occuring_event(double now)
 
 void CpuTiModel::update_actions_state(double now, double /*delta*/)
 {
 
 void CpuTiModel::update_actions_state(double now, double /*delta*/)
 {
-  while (not actionHeapIsEmpty() && actionHeapTopDate() <= now) {
+  while (not get_action_heap().empty() && actionHeapTopDate() <= now) {
     CpuTiAction* action = static_cast<CpuTiAction*>(actionHeapPop());
     XBT_DEBUG("Action %p: finish", action);
     action->finish(kernel::resource::Action::State::done);
     CpuTiAction* action = static_cast<CpuTiAction*>(actionHeapPop());
     XBT_DEBUG("Action %p: finish", action);
     action->finish(kernel::resource::Action::State::done);
index 157456c..fb07e6b 100644 (file)
@@ -159,7 +159,7 @@ LinkImpl* NetworkCm02Model::createLink(const std::string& name, double bandwidth
 
 void NetworkCm02Model::update_actions_state_lazy(double now, double /*delta*/)
 {
 
 void NetworkCm02Model::update_actions_state_lazy(double now, double /*delta*/)
 {
-  while (not actionHeapIsEmpty() && double_equals(actionHeapTopDate(), now, sg_surf_precision)) {
+  while (not get_action_heap().empty() && double_equals(actionHeapTopDate(), now, sg_surf_precision)) {
 
     NetworkCm02Action* action = static_cast<NetworkCm02Action*>(actionHeapPop());
     XBT_DEBUG("Something happened to action %p", action);
 
     NetworkCm02Action* action = static_cast<NetworkCm02Action*>(actionHeapPop());
     XBT_DEBUG("Something happened to action %p", action);