Speed up mock.findExpectedCall by skipping diff if not necessary
Summary
Speed up mock.findExpectedCall by skipping argument diffing if not necessary
Changes
Modified the function to skip over used up expected calls. Everything else remains the same from the user's perspective, including the associated special printed message for such cases.
Motivation
I have test suites with many one-time expected calls. I have noticed that the suite keeps accumulating such expired calls and evaluates every one of them before reaching the few usable ones. Ideally, such calls should be discarded to save space and cycles, but that's an optimization for another day.
Related issues
Closes #983
@boyan-soubachov I wonder if you can take a look?
@boyan-soubachov thank you for the review. I have updated the code to preserve visible behavior and a added a test case for expected error when a method has been used up to ensure consistent behavior before and after this change.