From a9f2cb6d6e791a0c1e7d588369da4bae6811653b Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 13 Jan 2016 09:31:06 -0800 Subject: [PATCH] Make `parseTypeOrTypePredicate` terser. --- src/compiler/parser.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index eaeb6452044..bfa5fb6ee1a 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -2541,11 +2541,7 @@ namespace ts { } function parseTypeOrTypePredicate(): TypeNode { - let typePredicateVariable: Identifier; - if (isIdentifier()) { - typePredicateVariable = tryParse(parseTypePredicatePrefix); - } - + const typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); const type = parseType(); if (typePredicateVariable) { const node = createNode(SyntaxKind.TypePredicate, typePredicateVariable.pos);