Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(48)

Issue 2956: Performance Enhancement for MockHandler : Search matchers once instead of twice

Can't Edit
Can't Publish+Mail
Start Review
Created:
17 years, 5 months ago by iczechowski
Modified:
2 years, 2 months ago
Reviewers:
szczepiq
Base URL:
http://mockito.googlecode.com/svn/trunk
Visibility:
Public.

Description

MockHandler currently calls these 2 methods in quick succession when providing the stubbed result for an invocation: mockitoStubber.hasResultFor(invocation) mockitoStubber.getResultFor(invocation) Unfortunately this involves duplication of work, because both methods call findMatch(invocation), which in turn will search *all* of the stubbed invocations against this mock instance. The search is performed twice, when it only needs to be performed once. See: http://code.google.com/p/mockito/issues/detail?id=19

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -8 lines) Patch
src/org/mockito/internal/MockHandler.java View 2 chunks +5 lines, -2 lines 0 comments Download
src/org/mockito/internal/stubbing/MockitoStubber.java View 1 chunk +2 lines, -6 lines 0 comments Download

Messages

Total messages: 1
iczechowski
17 years, 5 months ago (2008-08-18 15:57:26 UTC) #1

          
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b