Rewriting logic in finally block of PooledTaskRunner to avoid using a
return statement
This commit is contained in:
Christopher L. Shannon (cshannon) 2016-09-23 07:50:12 -04:00
parent d4c7cce7d7
commit f25e7ab47f
1 changed files with 9 additions and 10 deletions

View File

@ -142,17 +142,16 @@ class PooledTaskRunner implements TaskRunner {
if (shutdown) {
queued = false;
runable.notifyAll();
return;
}
} else {
// If we could not iterate all the items
// then we need to re-queue.
if (!done) {
queued = true;
}
// If we could not iterate all the items
// then we need to re-queue.
if (!done) {
queued = true;
}
if (queued) {
executor.execute(runable);
if (queued) {
executor.execute(runable);
}
}
}