Fix #5525: 修复 Task 进度异常的问题 (#5543)

This commit is contained in:
Glavo
2026-02-15 12:30:23 +08:00
committed by GitHub
parent d1ead74177
commit 32a741e2de

View File

@@ -346,12 +346,7 @@ public abstract class Task<T> {
if (count < 0 || total < 0)
throw new IllegalArgumentException("Invalid count or total: count=" + count + ", total=" + total);
double progress;
if (total >= count)
progress = 1.0;
else
progress = (double) count / total;
updateProgress(progress);
updateProgress(count < total ? (double) count / total : 1.0);
}
protected void updateProgress(double progress) {