Text_Diff::lcs

Advertisement

Summery Summery

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

Syntax Syntax

Text_Diff::lcs()

Description Description

This is mostly for diagnostic purposes.

Return Return

(integer) The length of the LCS.

Source Source

File: wp-includes/Text/Diff.php

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

Advertisement

Advertisement

Leave a Reply