Move array_diff / array_values into different lines in MD_STD::scandir
This leads a significant reduction in RAM usage.
This commit is contained in:
parent
aa67de1e54
commit
8e3d97aa7f
@ -63,7 +63,13 @@ final class MD_STD {
|
||||
throw new MDFileDoesNotExist("There is no file {$filepath}");
|
||||
}
|
||||
|
||||
return \array_values(\array_diff($output, ['.', '..', '.git']));
|
||||
// Remove unwanted files from list
|
||||
$output = \array_diff($output, ['.', '..', '.git']);
|
||||
|
||||
// Return array values, to make it a list rather than an associative array.
|
||||
// This should be done in a separate line, as it observably leads to a
|
||||
// significant reduction in the used RAM.
|
||||
return \array_values($output);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user