Skip to content

Commit 3a72fd5

Browse files
authored
Update Workflow.h
1 parent 235ce7a commit 3a72fd5

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/factory/Workflow.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ class ParallelWork : public ParallelTask
241241
{
242242
if (index < this->subtasks_nr)
243243
return this->all_series[index];
244+
else
245+
return NULL;
244246
}
245247

246248
SeriesWork& operator[] (size_t index)
@@ -257,10 +259,10 @@ class ParallelWork : public ParallelTask
257259

258260
public:
259261
SeriesWork *begin() { return this->series_at(0); }
260-
SeriesWork *end() { return this->series_at(this->size()); }
262+
SeriesWork *end() { return this->all_series + this->subtasks_nr;}
261263

262-
const SeriesWork *begin() const { return this->series_at(0); }
263-
const SeriesWork *end() const { return this->series_at(this->size()); }
264+
const SeriesWork *begin() const { return this->series_at(0);}
265+
ccons SeriesWork *end() const { return this->all_series + this->subtasks_nr;}
264266

265267
public:
266268
void set_callback(parallel_callback_t callback)

0 commit comments

Comments
 (0)