commit | 7f998102ea9b85d23123b1d31344b51d604db86c | [log] [tgz] |
---|---|---|
author | Xander Uiterlinden <uiterlix@apache.org> | Mon Oct 07 13:04:15 2013 +0000 |
committer | Xander Uiterlinden <uiterlix@apache.org> | Mon Oct 07 13:04:15 2013 +0000 |
tree | a612902db4551516f9062992d8909e7207bbe962 | |
parent | c11f06e67815d4eac23962f124c9d1e63866949e [diff] |
Small performance improvement in SerialExecutor trough preventing exceptions. git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1529831 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/SerialExecutor.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/SerialExecutor.java index c8a245b..4f5b640 100644 --- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/SerialExecutor.java +++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/SerialExecutor.java
@@ -77,12 +77,11 @@ private void scheduleNext() { Runnable active; synchronized (this) { - try { - m_active = (Runnable) m_workQueue.removeFirst(); - } - catch (NoSuchElementException e) { - m_active = null; - } + if (!m_workQueue.isEmpty()) { + m_active = (Runnable) m_workQueue.removeFirst(); + } else { + m_active = null; + } active = m_active; } if (active != null) {