Skip to content

Commit f1f2336

Browse files
committed
Remove syncronization from estimateProgress() function
1 parent 659fb99 commit f1f2336

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/rendermanager/CombinedRenderTask.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ public synchronized boolean hasMoreWork() {
6565
}
6666

6767
@Override
68-
public synchronized double estimateProgress() {
68+
public double estimateProgress() {
6969
if (!hasMoreWork()) return 1;
70+
int currentTask = this.currentTaskIndex;
71+
if (currentTask >= this.tasks.size()) return 1;
7072

71-
double total = currentTaskIndex;
72-
total += this.tasks.get(this.currentTaskIndex).estimateProgress();
73+
double total = currentTask;
74+
total += this.tasks.get(currentTask).estimateProgress();
7375

7476
return total / tasks.size();
7577
}

0 commit comments

Comments
 (0)