style: include LII_LIST_INDEXED_ITERATING (#5190)

This commit is contained in:
Piotr Idzik 2024-05-28 21:06:47 +02:00 committed by GitHub
parent 2cda944643
commit d2bfb100b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 6 deletions

View File

@ -141,9 +141,6 @@
<Match>
<Bug pattern="TR_TAIL_RECURSION" />
</Match>
<Match>
<Bug pattern="LII_LIST_INDEXED_ITERATING" />
</Match>
<Match>
<Bug pattern="USBR_UNNECESSARY_STORE_BEFORE_RETURN" />
</Match>

View File

@ -40,8 +40,8 @@ public class FCFSScheduling {
}
private void evaluateTurnAroundTime() {
for (int i = 0; i < processes.size(); i++) {
processes.get(i).setTurnAroundTimeTime(processes.get(i).getBurstTime() + processes.get(i).getWaitingTime());
for (final var process : processes) {
process.setTurnAroundTimeTime(process.getBurstTime() + process.getWaitingTime());
}
}
}

View File

@ -95,6 +95,8 @@ public class RRScheduling {
}
private void evaluateWaitingTime() {
for (int i = 0; i < processes.size(); i++) processes.get(i).setWaitingTime(processes.get(i).getTurnAroundTimeTime() - processes.get(i).getBurstTime());
for (final var process : processes) {
process.setWaitingTime(process.getTurnAroundTimeTime() - process.getBurstTime());
}
}
}