[Core] Early assign $smartFileInfo->getPathname() to variable for RemovedAndAddedFilesCollector::isFileRemoved() (#256)

* [Core] Early assign $smartFileInfo->getPathname() to variable for RemovedAndAddedFilesCollector::isFileRemoved()

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Abdul Malik Ikhsan 2021-06-20 18:50:38 +07:00 committed by GitHub
parent b62161e4cb
commit d0e6a3bda6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,8 +36,13 @@ final class RemovedAndAddedFilesCollector
public function isFileRemoved(SmartFileInfo $smartFileInfo): bool public function isFileRemoved(SmartFileInfo $smartFileInfo): bool
{ {
if ($this->removedFileInfos === []) {
return false;
}
$pathname = $smartFileInfo->getPathname();
foreach ($this->removedFileInfos as $removedFileInfo) { foreach ($this->removedFileInfos as $removedFileInfo) {
if ($removedFileInfo->getPathname() !== $smartFileInfo->getPathname()) { if ($removedFileInfo->getPathname() !== $pathname) {
continue; continue;
} }