Skip to content

Commit 9d45845

Browse files
authored
Merge pull request #34994 from Glandos/fileinfo_perf
[Performance] Test valid path only if file info has to be retrieved
2 parents abaa3ef + 48ca337 commit 9d45845

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/private/Files/Node/Node.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ protected function createNonExistingNode($path) {
9999
* @throws NotFoundException
100100
*/
101101
public function getFileInfo() {
102-
if (!Filesystem::isValidPath($this->path)) {
103-
throw new InvalidPathException();
104-
}
105102
if (!$this->fileInfo) {
103+
if (!Filesystem::isValidPath($this->path)) {
104+
throw new InvalidPathException();
105+
}
106106
$fileInfo = $this->view->getFileInfo($this->path);
107107
if ($fileInfo instanceof FileInfo) {
108108
$this->fileInfo = $fileInfo;

0 commit comments

Comments
 (0)