MCPcopy Create free account
hub / github.com/microsoft/SandDance / leastCommonAncestor

Function leastCommonAncestor

docs/app/js/sanddance-app.js:137713–137724  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

137711 return nodes;
137712};
137713function leastCommonAncestor(a, b) {
137714 if (a === b) return a;
137715 var aNodes = a.ancestors(), bNodes = b.ancestors(), c = null;
137716 a = aNodes.pop();
137717 b = bNodes.pop();
137718 while(a === b){
137719 c = a;
137720 a = aNodes.pop();
137721 b = bNodes.pop();
137722 }
137723 return c;
137724}
137725
137726},{"@parcel/transformer-js/src/esmodule-helpers.js":"jA2du"}],"5nXQ2":[function(require,module,exports) {
137727var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");

Callers 1

sanddance-app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected