Mercurial > hg > Members > sugi > javafx
changeset 31:5598fa745a51
refactor
author | sugi |
---|---|
date | Tue, 05 Nov 2013 20:19:30 +0900 |
parents | 7306b4ea110e |
children | e580cd6b225a |
files | src/alice/topology/manager/keeparive/PingScheduler.java |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/alice/topology/manager/keeparive/PingScheduler.java Tue Nov 05 14:19:21 2013 +0900 +++ b/src/alice/topology/manager/keeparive/PingScheduler.java Tue Nov 05 20:19:30 2013 +0900 @@ -64,24 +64,24 @@ if (list.isEmpty()) { list.add(newInfo); } else { - for (int cnt = 0; cnt < list.size(); cnt++){ - TaskInfo info = list.get(cnt); + int cnt = 0; + for (TaskInfo info : list){ if (info.getTime() < newInfo.getTime()){ newInfo.setTime(newInfo.getTime() - info.getTime()); if (cnt+1 == list.size()){ - list.add(newInfo); break; } } else if (info.getTime() == newInfo.getTime()){ newInfo.setTime(newInfo.getTime() - info.getTime()); - list.add(cnt+1, newInfo); + cnt++; break; } else if (info.getTime() > newInfo.getTime()){ info.setTime(info.getTime() - newInfo.getTime()); - list.add(cnt, newInfo); break; } + cnt++; } + list.add(cnt, newInfo); } updateFlag = true; }