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

Replace loop with division.

parent 6d2a0a78
No related branches found
No related tags found
2 merge requests!91Add alternative code path for huge buffers.,!89Miscellaneous fixes and CDI-PIO improvements
......@@ -242,10 +242,11 @@ get_local_step_and_recId(stream_t *streamptr, long globalRecId,
localTsId++;
globalRecId -= tsteps[0].nrecs;
}
while (globalRecId >= tsteps[1].nrecs)
if (globalRecId >= tsteps[1].nrecs)
{
localTsId++;
globalRecId -= tsteps[1].nrecs;
ldiv_t nadjust = ldiv(globalRecId, tsteps[1].nrecs);
localTsId += (int)nadjust.quot;
globalRecId = nadjust.rem;
}
*tsID = localTsId;
......
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