提交 5485cf96 编写于 作者: K Kohsuke Kawaguchi

Removed code duplication

getItem() and contains() act exactly the same
上级 81e00cc6
......@@ -1093,25 +1093,7 @@ public class Queue extends ResourceController implements Saveable {
* Returns true if this queue contains the said project.
*/
public boolean contains(Task t) {
final Snapshot snapshot = this.snapshot;
for (Item item : snapshot.blockedProjects) {
if (item.task.equals(t))
return true;
}
for (Item item : snapshot.buildables) {
if (item.task.equals(t))
return true;
}
for (Item item : snapshot.pendings) {
if (item.task.equals(t))
return true;
}
for (Item item : snapshot.waitingList) {
if (item.task.equals(t)) {
return true;
}
}
return false;
return getItem(t)!=null;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册