mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 13:25:37 +00:00
Bug 1102131 - Part 6: Remove deprecated let block in DownloadsCommon.jsm. r=mak
--HG-- extra : rebase_source : d8b36142d84edf02fd88cb303b7fa61140bccc48
This commit is contained in:
parent
6e2ef091e8
commit
9d28632ec4
@ -413,13 +413,12 @@ this.DownloadsCommon = {
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user