From 9bb8e8e9928be8bcdfb4f024f780a5e379809c42 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Mon, 12 Oct 2015 19:53:30 +0100 Subject: [PATCH] Don't use a successful variable to track if all items were extracted. --- .../src/com/reecedunn/espeak/DownloadVoiceData.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/android/src/com/reecedunn/espeak/DownloadVoiceData.java b/android/src/com/reecedunn/espeak/DownloadVoiceData.java index ed17493b..43ce907a 100755 --- a/android/src/com/reecedunn/espeak/DownloadVoiceData.java +++ b/android/src/com/reecedunn/espeak/DownloadVoiceData.java @@ -96,8 +96,6 @@ public class DownloadVoiceData extends Activity { final InputStream stream = mContext.getResources().openRawResource(mRawResId); final ZipInputStream zipStream = new ZipInputStream(new BufferedInputStream(stream)); - boolean successful = false; - try { final byte[] buffer = new byte[10240]; @@ -134,7 +132,8 @@ public class DownloadVoiceData extends Activity { final File outputFile = new File(mOutput, "espeak-data/version"); FileUtils.write(outputFile, version); - successful = true; + + return RESULT_OK; } catch (Exception e) { e.printStackTrace(); } finally { @@ -145,11 +144,7 @@ public class DownloadVoiceData extends Activity { } } - if (isCancelled() || !successful) { - return RESULT_CANCELED; - } - - return RESULT_OK; + return RESULT_CANCELED; } } }