提交 533cfe47 编写于 作者: K Kohsuke Kawaguchi

simplified

上级 af55e534
......@@ -232,10 +232,8 @@ public abstract class LoadStatistics {
private int count(List<Queue.BuildableItem> bis, Label l) {
int q=0;
for (Queue.BuildableItem bi : bis) {
if(bi.task.getAssignedLabel()==l)
q++;
for (SubTask st : Tasks.getSubTasksOf(bi.task))
if (st != bi.task && st.getAssignedLabel()==l)
if (st.getAssignedLabel()==l)
q++;
}
return q;
......
......@@ -756,19 +756,13 @@ public class Queue extends ResourceController implements Saveable {
public synchronized int countBuildableItemsFor(Label l) {
int r = 0;
for (BuildableItem bi : buildables.values())
if(null==l || bi.getAssignedLabel()==l) {
r++;
for (SubTask st : bi.task.getSubTasks())
if (st != bi.task && (null==l || st.getAssignedLabel()==l))
r++;
}
for (SubTask st : bi.task.getSubTasks())
if (null==l || st.getAssignedLabel()==l)
r++;
for (BuildableItem bi : pendings.values())
if(bi.getAssignedLabel()==l) {
r++;
for (SubTask st : bi.task.getSubTasks())
if (st != bi.task && (null==l || st.getAssignedLabel()==l))
r++;
}
for (SubTask st : bi.task.getSubTasks())
if (null==l || st.getAssignedLabel()==l)
r++;
return r;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册