Skip to content
Snippets Groups Projects
Commit d653c2a3 authored by sfphoton's avatar sfphoton
Browse files

Bugfix: Tasks with equal start times are now stored and added to scheduler in input order

parent 38001d74
Branches
No related tags found
No related merge requests found
...@@ -30,7 +30,7 @@ public class Main { ...@@ -30,7 +30,7 @@ public class Main {
if (tasks.size() == 0) {tasks.add(readTask);} if (tasks.size() == 0) {tasks.add(readTask);}
else { else {
int i=0; int i=0;
while(tasks.size() <= i && tasks.get(i).startTime < readTask.startTime) i++; while(tasks.size() > i && tasks.get(i).startTime <= readTask.startTime) i++;
tasks.add(i, readTask); tasks.add(i, readTask);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment