From 95354136be5de6055302fa1b992b86ec40a010c6 Mon Sep 17 00:00:00 2001 From: fonsinchen Date: Fri, 24 Jan 2014 21:39:07 +0000 Subject: (svn r26276) -Fix [FS#5874]: Don't spawn link graph jobs for link graphs with only one node --- src/linkgraph/linkgraphschedule.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/linkgraph') diff --git a/src/linkgraph/linkgraphschedule.cpp b/src/linkgraph/linkgraphschedule.cpp index f056d7cfc..b3e6fac2f 100644 --- a/src/linkgraph/linkgraphschedule.cpp +++ b/src/linkgraph/linkgraphschedule.cpp @@ -57,6 +57,12 @@ void LinkGraphSchedule::SpawnNext() { if (this->schedule.empty()) return; LinkGraph *next = this->schedule.front(); + LinkGraph *first = next; + while (next->Size() < 2) { + this->schedule.splice(this->schedule.end(), this->schedule, this->schedule.begin()); + next = this->schedule.front(); + if (next == first) return; + } assert(next == LinkGraph::Get(next->index)); this->schedule.pop_front(); if (LinkGraphJob::CanAllocateItem()) { -- cgit v1.2.3-70-g09d2