Skip to content

Commit

Permalink
Avoid shadowing result in remainingWait. (#3280)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Feb 3, 2018
1 parent 20c5307 commit f831977
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lodash.js
Original file line number Diff line number Diff line change
Expand Up @@ -10339,9 +10339,11 @@
function remainingWait(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime,
result = wait - timeSinceLastCall;
timeWaiting = wait - timeSinceLastCall;

return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
return maxing
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
: timeWaiting;
}

function shouldInvoke(time) {
Expand Down

0 comments on commit f831977

Please sign in to comment.