From b0435d84906fff07bebd9889ab6f560590eccf9a Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 28 Jul 2017 19:03:47 -0700 Subject: [PATCH] Replace a 'forEach' with 'find' (#17499) --- src/compiler/checker.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 212de3a2159..59ba59be53c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19530,10 +19530,9 @@ namespace ts { // Since the javascript won't do semantic analysis like typescript, // if the javascript file comes before the typescript file and both contain same name functions, // checkFunctionOrConstructorSymbol wouldn't be called if we didnt ignore javascript function. - const firstDeclaration = forEach(localSymbol.declarations, + const firstDeclaration = find(localSymbol.declarations, // Get first non javascript function declaration - declaration => declaration.kind === node.kind && !isSourceFileJavaScript(getSourceFileOfNode(declaration)) ? - declaration : undefined); + declaration => declaration.kind === node.kind && !isSourceFileJavaScript(getSourceFileOfNode(declaration))); // Only type check the symbol once if (node === firstDeclaration) {