mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
diff: remove unnecessary check
indicator.isCanceled() is already checked in BackgroundTaskUtil. This check also duplicates check for myDisposed.
This commit is contained in:
@@ -91,26 +91,7 @@ public class DiffTaskQueue implements Disposable {
|
||||
if (myDisposed) return;
|
||||
abort();
|
||||
|
||||
Function<ProgressIndicator, Runnable> function = new Function<ProgressIndicator, Runnable>() {
|
||||
@Override
|
||||
@CalledInBackground
|
||||
public Runnable fun(final ProgressIndicator indicator) {
|
||||
final Runnable callback = backgroundTask.fun(indicator);
|
||||
return new Runnable() {
|
||||
@Override
|
||||
@CalledInAwt
|
||||
public void run() {
|
||||
synchronized (LOCK) {
|
||||
if (myDisposed) return;
|
||||
indicator.checkCanceled();
|
||||
}
|
||||
callback.run();
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
myProgressIndicator.set(BackgroundTaskUtil.executeAndTryWait(function, onSlowAction, waitMillis, forceEDT));
|
||||
myProgressIndicator.set(BackgroundTaskUtil.executeAndTryWait(backgroundTask, onSlowAction, waitMillis, forceEDT));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user