Text_Diff::lcs()publicWP 1.0

Computes the length of the Longest Common Subsequence (LCS).

This is mostly for diagnostic purposes.

Метод класса: Text_Diff{}

Хуков нет.

Возвращает

int. The length of the LCS.

Использование

$Text_Diff = new Text_Diff();
$Text_Diff->lcs();

Код Text_Diff::lcs() WP 6.7.1

function lcs()
{
    $lcs = 0;
    foreach ($this->_edits as $edit) {
        if (is_a($edit, 'Text_Diff_Op_copy')) {
            $lcs += count($edit->orig);
        }
    }
    return $lcs;
}