MCPcopy Index your code
hub / github.com/apache/groovy / handleMatches

Method handleMatches

src/main/java/groovy/lang/MetaClassImpl.java:3629–3641  ·  view source on GitHub ↗

Updates the current best-match set using the supplied distance metric. @param matchesDistance the best distance seen so far @param matches the current best candidates @param method the candidate method @param dist the candidate distance @return the updated best distance

(long matchesDistance, LinkedList matches, Object method, long dist)

Source from the content-addressed store, hash-verified

3627 * @return the updated best distance
3628 */
3629 protected static long handleMatches(long matchesDistance, LinkedList matches, Object method, long dist) {
3630 if (matches.isEmpty()) {
3631 matches.add(method);
3632 matchesDistance = dist;
3633 } else if (dist < matchesDistance) {
3634 matchesDistance = dist;
3635 matches.clear();
3636 matches.add(method);
3637 } else if (dist == matchesDistance) {
3638 matches.add(method);
3639 }
3640 return matchesDistance;
3641 }
3642
3643 /**
3644 * Complete the initialisation process. After this method

Callers 1

Calls 3

addMethod · 0.65
clearMethod · 0.65
isEmptyMethod · 0.45

Tested by

no test coverage detected