From a56eb951f2c264a3a1c8d8955c64903b75f62c02 Mon Sep 17 00:00:00 2001 From: Arnaud Legrand Date: Mon, 5 Mar 2012 11:09:57 +0100 Subject: [PATCH] Cosmetics + warning --- src/surf/cpu_cas01.c | 7 ++----- src/surf/network.c | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/surf/cpu_cas01.c b/src/surf/cpu_cas01.c index c94bf46744..3d00787367 100644 --- a/src/surf/cpu_cas01.c +++ b/src/surf/cpu_cas01.c @@ -314,15 +314,12 @@ static double cpu_share_resources_lazy(double now) GENERIC_ACTION(action).start, now + value, GENERIC_ACTION(action).max_duration); - if (action->index_heap >= 0) { - heap_remove(action); - } - if (min != -1) { + heap_remove(action); heap_insert(action, min, max_dur_flag ? MAX_DURATION : NORMAL); XBT_DEBUG("Insert at heap action(%p) min %lf now %lf", action, min, now); - } + } else DIE_IMPOSSIBLE; } //hereafter must have already the min value for this resource model diff --git a/src/surf/network.c b/src/surf/network.c index e2d92fd8b9..0e1bcab338 100644 --- a/src/surf/network.c +++ b/src/surf/network.c @@ -509,15 +509,12 @@ static double net_share_resources_lazy(double now) GENERIC_ACTION(action).start, now + value, GENERIC_ACTION(action).max_duration); - if (action->index_heap >= 0) { - heap_remove(action); - } - if (min != -1) { + heap_remove(action); heap_insert(action, min, max_dur_flag ? MAX_DURATION : NORMAL); XBT_DEBUG("Insert at heap action(%p) min %lf now %lf", action, min, now); - } + } else DIE_IMPOSSIBLE; } //hereafter must have already the min value for this resource model -- 2.20.1