Skip to content

Commit 8f2433d

Browse files
committed
fix #4907
1 parent 75d10ed commit 8f2433d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ortools/sat/subsolver.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,12 @@ class SubSolver {
101101
// called sequentially. Subclasses do not need to call this.
102102
void AddTaskDuration(double duration_in_seconds) {
103103
++num_finished_tasks_;
104-
wall_time_ += duration_in_seconds;
105-
timing_.AddTimeInSec(duration_in_seconds);
104+
if (duration_in_seconds > 0) {
105+
wall_time_ += duration_in_seconds;
106+
timing_.AddTimeInSec(duration_in_seconds);
107+
}
106108
}
107109

108-
// Note that this is protected by the global execution mutex and so it is
109110
// called sequentially. Subclasses do not need to call this.
110111
void NotifySelection() { ++num_scheduled_tasks_; }
111112

0 commit comments

Comments
 (0)