Skip to content

Commit

Permalink
simplify nested if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
krzkaczor authored and mroderick committed Feb 10, 2018
1 parent 3e7edca commit beea2f6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/sinon/spy.js
Expand Up @@ -395,10 +395,8 @@ function delegateToCalls(method, matchAny, actual, notCalled, totalCallCount) {
return false;
}

if (totalCallCount !== undefined) {
if (this.callCount !== totalCallCount) {
return false;
}
if (totalCallCount !== undefined && this.callCount !== totalCallCount) {
return false;
}

var currentCall;
Expand Down

0 comments on commit beea2f6

Please sign in to comment.