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

Function commonpath

src/util/path.py:922–926  ·  view source on GitHub ↗
(l1, l2, common=[])

Source from the content-addressed store, hash-verified

920 return split(h,[t]+rest)
921
922def commonpath(l1, l2, common=[]):
923 if len(l1) < 1: return (common, l1, l2)
924 if len(l2) < 1: return (common, l1, l2)
925 if l1[0] != l2[0]: return (common, l1, l2)
926 return commonpath(l1[1:], l2[1:], common+[l1[0]])
927
928def relpath(p1, p2):
929 (common,l1,l2) = commonpath(split(p1), split(p2))

Callers 1

relpathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected