workerpool: Use itertools.count instead of manual counting
Instead of having to explicitely increment the value (“… += 1”), a call to next() is enough. These numbers should in no case be re-used (they are used for ordering tasks). Using “itertools.count” is useful here as it guarantees that a returned number won't be returned another time. Manual code for this could, over the course of time, gain unintended bugs. Signed-off-by:Michael Hanselmann <hansmi@google.com> Reviewed-by:
Bernardo Dal Seno <bdalseno@google.com>
Please register or sign in to comment