Skip to content

Commit

Permalink
Added memoization to match results during request -> stub near miss c…
Browse files Browse the repository at this point in the history
…alculation
  • Loading branch information
tomakehurst committed Sep 10, 2020
1 parent b9a3865 commit 56d7a08
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public List<NearMiss> findNearestTo(final RequestPattern requestPattern) {
List<ServeEvent> serveEvents = requestJournal.getAllServeEvents();
return sortAndTruncate(from(serveEvents).transform(new Function<ServeEvent, NearMiss>() {
public NearMiss apply(ServeEvent serveEvent) {
MatchResult matchResult = requestPattern.match(serveEvent.getRequest());
MatchResult matchResult = new MemoizingMatchResult(requestPattern.match(serveEvent.getRequest()));
return new NearMiss(serveEvent.getRequest(), requestPattern, matchResult);
}
}), serveEvents.size());
Expand Down

0 comments on commit 56d7a08

Please sign in to comment.