Skip to content

Commit 21e24c9

Browse files
Apply review suggestions
1 parent 9282cce commit 21e24c9

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

app/src/main/java/us/shandian/giga/service/DownloadManager.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ private void loadPendingMissions(Context ctx) {
169169
// DON'T delete missions with storage issues - try to recover them
170170
if (mis.hasInvalidStorage() && mis.errCode != ERROR_PROGRESS_LOST) {
171171
// Only delete if it's truly unrecoverable (not just progress lost)
172-
if (mis.storage == null && mis.errCode != ERROR_PROGRESS_LOST) {
172+
if (mis.storage == null) {
173173
//noinspection ResultOfMethodCallIgnored
174174
sub.delete();
175175
continue;
@@ -612,11 +612,8 @@ private ArrayList<Object> getSpecialItems() {
612612

613613
// Don't hide recoverable missions
614614
remove.removeIf(mission -> {
615-
if (mission instanceof DownloadMission) {
616-
DownloadMission dm = (DownloadMission) mission;
617-
if (canRecoverMission(dm)) {
618-
return false; // Don't remove recoverable missions
619-
}
615+
if (mission instanceof DownloadMission dm && canRecoverMission(dm)) {
616+
return false; // Don't remove recoverable missions
620617
}
621618
return pending.remove(mission) || finished.remove(mission);
622619
});

0 commit comments

Comments
 (0)