MCPcopy Create free account
hub / github.com/boostorg/build / select_highest_ranked

Function select_highest_ranked

v2/util/sequence.py:33–50  ·  view source on GitHub ↗

Returns all of 'elements' for which corresponding element in parallel list 'rank' is equal to the maximum value in 'rank'.

(elements, ranks)

Source from the content-addressed store, hash-verified

31 return max
32
33def select_highest_ranked (elements, ranks):
34 """ Returns all of 'elements' for which corresponding element in parallel
35 list 'rank' is equal to the maximum value in 'rank'.
36 """
37 if not elements:
38 return []
39
40 max_rank = max_element (ranks)
41
42 result = []
43 while elements:
44 if ranks [0] == max_rank:
45 result.append (elements [0])
46
47 elements = elements [1:]
48 ranks = ranks [1:]
49
50 return result

Callers

nothing calls this directly

Calls 2

max_elementFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected