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

Function commonpath

v2/util/path.py:889–893  ·  view source on GitHub ↗
(l1, l2, common=[])

Source from the content-addressed store, hash-verified

887 return split(h,[t]+rest)
888
889def commonpath(l1, l2, common=[]):
890 if len(l1) < 1: return (common, l1, l2)
891 if len(l2) < 1: return (common, l1, l2)
892 if l1[0] != l2[0]: return (common, l1, l2)
893 return commonpath(l1[1:], l2[1:], common+[l1[0]])
894
895def relpath(p1, p2):
896 (common,l1,l2) = commonpath(split(p1), split(p2))

Callers 1

relpathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected