Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Differ.php

function Differ::selectLcsImplementation

1 call to Differ::selectLcsImplementation()
Differ::diffToArray in vendor/sebastian/diff/src/Differ.php

File

vendor/sebastian/diff/src/Differ.php, line 117

Class

Differ

Namespace

SebastianBergmann\Diff

Code

private function selectLcsImplementation(array $from, array $to) : LongestCommonSubsequenceCalculator {
    // We do not want to use the time-efficient implementation if its memory
    // footprint will probably exceed this value. Note that the footprint
    // calculation is only an estimation for the matrix and the LCS method
    // will typically allocate a bit more memory than this.
    $memoryLimit = 100 * 1024 * 1024;
    if ($this->calculateEstimatedFootprint($from, $to) > $memoryLimit) {
        return new MemoryEfficientLongestCommonSubsequenceCalculator();
    }
    return new TimeEfficientLongestCommonSubsequenceCalculator();
}
RSS feed
Powered by Drupal