Bug 1102131 - Part 6: Remove deprecated let block in DownloadsCommon.jsm. r=mak
authorChris Peterson <cpeterson@mozilla.com>
Wed, 19 Nov 2014 23:50:58 -0800
changeset 216980 942b4e3c6a0782d9ca94bec8efb510e43de4fe07
parent 216979 2404514c21656b9ea50ef2dec41b011c4be6c175
child 216981 11331afc4ffeeba65bb4428f97124a8cb3b199eb
push id52189
push usercpeterson@mozilla.com
push dateSat, 22 Nov 2014 01:05:51 +0000
treeherdermozilla-inbound@942b4e3c6a07 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1102131
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1102131 - Part 6: Remove deprecated let block in DownloadsCommon.jsm. r=mak
browser/components/downloads/DownloadsCommon.jsm
--- a/browser/components/downloads/DownloadsCommon.jsm
+++ b/browser/components/downloads/DownloadsCommon.jsm
@@ -408,23 +408,22 @@ this.DownloadsCommon = {
     // We apply an algorithm similar to the DownloadUtils.getTimeLeft function,
     // though tailored to a single time estimation for all downloads.  We never
     // apply something if the new value is less than half the previous value.
     let shouldApplySmoothing = aLastSeconds >= 0 &&
                                aSeconds > aLastSeconds / 2;
     if (shouldApplySmoothing) {
       // Apply hysteresis to favor downward over upward swings.  Trust only 30%
       // of the new value if lower, and 10% if higher (exponential smoothing).
-      let (diff = aSeconds - aLastSeconds) {
-        aSeconds = aLastSeconds + (diff < 0 ? .3 : .1) * diff;
-      }
+      let diff = aSeconds - aLastSeconds;
+      aSeconds = aLastSeconds + (diff < 0 ? .3 : .1) * diff;
 
       // If the new time is similar, reuse something close to the last time
       // left, but subtract a little to provide forward progress.
-      let diff = aSeconds - aLastSeconds;
+      diff = aSeconds - aLastSeconds;
       let diffPercent = diff / aLastSeconds * 100;
       if (Math.abs(diff) < 5 || Math.abs(diffPercent) < 5) {
         aSeconds = aLastSeconds - (diff < 0 ? .4 : .2);
       }
     }
 
     // In the last few seconds of downloading, we are always subtracting and
     // never adding to the time left.  Ensure that we never fall below one