Skip to content
Snippets Groups Projects
Commit 343dd1a6 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Shorten loops by eliding temporary.

* Additional pointers complicate alias analysis.
parent 5b6fe88e
No related branches found
No related tags found
2 merge requests!91Add alternative code path for huge buffers.,!89Miscellaneous fixes and CDI-PIO improvements
......@@ -925,23 +925,18 @@ cdf_read_next_record(stream_t *streamptr, int recID, int memtype, void *data, si
// Start as many new jobs as possible.
for (int i = 0; streamptr->nextGlobalRecId < streamptr->maxGlobalRecs && i < workerCount; i++)
{
JobDescriptor *jd = &jobs[i];
if (jd->args.recID < 0 && jd->args.tsID < 0) read_next_record(jobManager, jd, streamptr, memtype);
}
if (jobs[i].args.recID < 0 && jobs[i].args.tsID < 0)
read_next_record(jobManager, jobs+i, streamptr, memtype);
}
// search for a job descriptor with the given tsID and recID, and use its results if it exists
for (int i = 0; !jobFound && i < workerCount; i++)
{
JobDescriptor *jd = &jobs[i];
if (jd->args.recID == recID && jd->args.tsID == tsID)
{
jobFound = true;
JobDescriptor_finishJob(jobManager, jd, data, numMissVals);
if (streamptr->nextGlobalRecId < streamptr->maxGlobalRecs) read_next_record(jobManager, jd, streamptr, memtype);
}
}
if (jobs[i].args.recID == recID && jobs[i].args.tsID == tsID)
{
jobFound = true;
JobDescriptor_finishJob(jobManager, jobs+i, data, numMissVals);
if (streamptr->nextGlobalRecId < streamptr->maxGlobalRecs) read_next_record(jobManager, jobs+i, streamptr, memtype);
}
}
// perform the work synchronously if we didn't start a job for it yet
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment