Changeset View
Changeset View
Standalone View
Standalone View
src/parser/ArcanistBundle.php
Show First 20 Lines • Show All 633 Lines • ▼ Show 20 Lines | private function encodeGitTargetPath($path) { | ||||
return $path; | return $path; | ||||
} | } | ||||
private function getOldPath(ArcanistDiffChange $change) { | private function getOldPath(ArcanistDiffChange $change) { | ||||
$old_path = $change->getOldPath(); | $old_path = $change->getOldPath(); | ||||
$type = $change->getType(); | $type = $change->getType(); | ||||
if (!strlen($old_path) || | if ($old_path === '' || $type == ArcanistDiffChangeType::TYPE_ADD) { | ||||
$type == ArcanistDiffChangeType::TYPE_ADD) { | |||||
$old_path = null; | $old_path = null; | ||||
} | } | ||||
return $old_path; | return $old_path; | ||||
} | } | ||||
private function getCurrentPath(ArcanistDiffChange $change) { | private function getCurrentPath(ArcanistDiffChange $change) { | ||||
$cur_path = $change->getCurrentPath(); | $cur_path = $change->getCurrentPath(); | ||||
▲ Show 20 Lines • Show All 366 Lines • ▼ Show 20 Lines | foreach ($lines as $idx => $line) { | ||||
$slice = ''; | $slice = ''; | ||||
// If we're in 64bit mode, we can just use integers. Otherwise, we | // If we're in 64bit mode, we can just use integers. Otherwise, we | ||||
// need to use floating point math to avoid overflows. | // need to use floating point math to avoid overflows. | ||||
if ($is_64bit) { | if ($is_64bit) { | ||||
for ($count = 4; $count >= 0; $count--) { | for ($count = 4; $count >= 0; $count--) { | ||||
$val = $accum % 85; | $val = $accum % 85; | ||||
$accum = $accum / 85; | $accum = (int)($accum / 85); | ||||
$slice .= $map[$val]; | $slice .= $map[$val]; | ||||
} | } | ||||
} else { | } else { | ||||
for ($count = 4; $count >= 0; $count--) { | for ($count = 4; $count >= 0; $count--) { | ||||
$val = (int)fmod($accum, 85.0); | $val = (int)fmod($accum, 85.0); | ||||
$accum = floor($accum / 85.0); | $accum = floor($accum / 85.0); | ||||
$slice .= $map[$val]; | $slice .= $map[$val]; | ||||
} | } | ||||
Show All 29 Lines |