From b67dc024768e296c0c0214e5504855bda795ce08 Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Wed, 12 Nov 2025 03:16:33 +0100 Subject: [PATCH] fix #4907 --- ortools/sat/subsolver.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ortools/sat/subsolver.h b/ortools/sat/subsolver.h index f915a9e756..09ca82168f 100644 --- a/ortools/sat/subsolver.h +++ b/ortools/sat/subsolver.h @@ -101,11 +101,12 @@ class SubSolver { // called sequentially. Subclasses do not need to call this. void AddTaskDuration(double duration_in_seconds) { ++num_finished_tasks_; - wall_time_ += duration_in_seconds; - timing_.AddTimeInSec(duration_in_seconds); + if (duration_in_seconds > 0) { + wall_time_ += duration_in_seconds; + timing_.AddTimeInSec(duration_in_seconds); + } } - // Note that this is protected by the global execution mutex and so it is // called sequentially. Subclasses do not need to call this. void NotifySelection() { ++num_scheduled_tasks_; }