Support range-based 'for' loop for ParallelWork. (#1786)

This commit is contained in:
xiehan
2025-10-09 22:05:34 +08:00
committed by GitHub
parent 50d5717035
commit 649a65e983
3 changed files with 19 additions and 16 deletions

View File

@@ -26,11 +26,10 @@ void callback(const ParallelWork *pwork)
tutorial_series_context *ctx;
const void *body;
size_t size;
size_t i;
for (i = 0; i < pwork->size(); i++)
for (const SeriesWork *series : *pwork)
{
ctx = (tutorial_series_context *)pwork->series_at(i)->get_context();
ctx = (tutorial_series_context *)series->get_context();
printf("%s\n", ctx->url.c_str());
if (ctx->state == WFT_STATE_SUCCESS)
{