From d2bfb100b22a1b8ad86d99dfcc75a5f65db6e874 Mon Sep 17 00:00:00 2001
From: Piotr Idzik <65706193+vil02@users.noreply.github.com>
Date: Tue, 28 May 2024 21:06:47 +0200
Subject: [PATCH] style: include `LII_LIST_INDEXED_ITERATING` (#5190)
---
spotbugs-exclude.xml | 3 ---
.../java/com/thealgorithms/scheduling/FCFSScheduling.java | 4 ++--
src/main/java/com/thealgorithms/scheduling/RRScheduling.java | 4 +++-
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/spotbugs-exclude.xml b/spotbugs-exclude.xml
index 45ea8ed0..02e03725 100644
--- a/spotbugs-exclude.xml
+++ b/spotbugs-exclude.xml
@@ -141,9 +141,6 @@
-
-
-
diff --git a/src/main/java/com/thealgorithms/scheduling/FCFSScheduling.java b/src/main/java/com/thealgorithms/scheduling/FCFSScheduling.java
index e73937f6..b22e81fe 100644
--- a/src/main/java/com/thealgorithms/scheduling/FCFSScheduling.java
+++ b/src/main/java/com/thealgorithms/scheduling/FCFSScheduling.java
@@ -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());
}
}
}
diff --git a/src/main/java/com/thealgorithms/scheduling/RRScheduling.java b/src/main/java/com/thealgorithms/scheduling/RRScheduling.java
index 9968f172..991c9a4f 100644
--- a/src/main/java/com/thealgorithms/scheduling/RRScheduling.java
+++ b/src/main/java/com/thealgorithms/scheduling/RRScheduling.java
@@ -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());
+ }
}
}