Changeset View
Changeset View
Standalone View
Standalone View
src/difference/ArcanistDiffVectorNode.php
Show All 33 Lines | public function getParentNode() { | ||||
return $this->parentNode; | return $this->parentNode; | ||||
} | } | ||||
public function addChild(array $vector, $length, $idx) { | public function addChild(array $vector, $length, $idx) { | ||||
$is_node = ($idx === ($length - 1)); | $is_node = ($idx === ($length - 1)); | ||||
$element = $vector[$idx]; | $element = $vector[$idx]; | ||||
if (!isset($this->children[$element])) { | if (!isset($this->children[$element])) { | ||||
$this->children[$element] = id(new self()) | $this->children[$element] = (new self()) | ||||
->setParentNode($this) | ->setParentNode($this) | ||||
->setVector(array_slice($vector, 0, $idx + 1)); | ->setVector(array_slice($vector, 0, $idx + 1)); | ||||
} | } | ||||
$child = $this->children[$element]; | $child = $this->children[$element]; | ||||
if ($is_node) { | if ($is_node) { | ||||
$child->setValueNode($child); | $child->setValueNode($child); | ||||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0