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
Namespace
SebastianBergmann\DiffCode
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();
}