Text_Diff_Engine_native::_lcsPos()publicWP 1.0

Method of the class: Text_Diff_Engine_native{}

No Hooks.

Return

null. Nothing (null).

Usage

$Text_Diff_Engine_native = new Text_Diff_Engine_native();
$Text_Diff_Engine_native->_lcsPos( $ypos );
$ypos (required)
-

Text_Diff_Engine_native::_lcsPos() code WP 6.5.2

function _lcsPos($ypos)
{
    $end = $this->lcs;
    if ($end == 0 || $ypos > $this->seq[$end]) {
        $this->seq[++$this->lcs] = $ypos;
        $this->in_seq[$ypos] = 1;
        return $this->lcs;
    }

    $beg = 1;
    while ($beg < $end) {
        $mid = (int)(($beg + $end) / 2);
        if ($ypos > $this->seq[$mid]) {
            $beg = $mid + 1;
        } else {
            $end = $mid;
        }
    }

    assert($ypos != $this->seq[$end]);

    $this->in_seq[$this->seq[$end]] = false;
    $this->seq[$end] = $ypos;
    $this->in_seq[$ypos] = 1;
    return $end;
}