Remove syncronization from estimateProgress() function

This commit is contained in:
Lukas Rieger (Blue) 2023-05-15 17:01:10 +02:00
parent 659fb99eb6
commit f1f2336dff
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2
1 changed files with 5 additions and 3 deletions

View File

@ -65,11 +65,13 @@ public class CombinedRenderTask<T extends RenderTask> implements RenderTask {
}
@Override
public synchronized double estimateProgress() {
public double estimateProgress() {
if (!hasMoreWork()) return 1;
int currentTask = this.currentTaskIndex;
if (currentTask >= this.tasks.size()) return 1;
double total = currentTaskIndex;
total += this.tasks.get(this.currentTaskIndex).estimateProgress();
double total = currentTask;
total += this.tasks.get(currentTask).estimateProgress();
return total / tasks.size();
}