diff --git a/MD_STD.php b/MD_STD.php index fe93d44..2313e4a 100644 --- a/MD_STD.php +++ b/MD_STD.php @@ -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); }