mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-09-27 14:52:57 +02:00
Remove syncronization from estimateProgress() function
This commit is contained in:
parent
659fb99eb6
commit
f1f2336dff
@ -65,11 +65,13 @@ public synchronized boolean hasMoreWork() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized double estimateProgress() {
|
public double estimateProgress() {
|
||||||
if (!hasMoreWork()) return 1;
|
if (!hasMoreWork()) return 1;
|
||||||
|
int currentTask = this.currentTaskIndex;
|
||||||
|
if (currentTask >= this.tasks.size()) return 1;
|
||||||
|
|
||||||
double total = currentTaskIndex;
|
double total = currentTask;
|
||||||
total += this.tasks.get(this.currentTaskIndex).estimateProgress();
|
total += this.tasks.get(currentTask).estimateProgress();
|
||||||
|
|
||||||
return total / tasks.size();
|
return total / tasks.size();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user