optimization, reduce memory usage (#61822)

This commit is contained in:
VincentBailly 2025-06-09 20:48:30 +02:00 committed by GitHub
parent 355b9e0984
commit 97cfa26f2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4986,8 +4986,8 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host: HostForUseSource
function fileOrDirectoryExistsUsingSource(fileOrDirectory: string, isFile: boolean): boolean {
const fileOrDirectoryExistsUsingSource = isFile ?
(file: string) => fileExistsIfProjectReferenceDts(file) :
(dir: string) => directoryExistsIfProjectReferenceDeclDir(dir);
fileExistsIfProjectReferenceDts :
directoryExistsIfProjectReferenceDeclDir;
// Check current directory or file
const result = fileOrDirectoryExistsUsingSource(fileOrDirectory);
if (result !== undefined) return result;