From 5cc8a9c2a7d18affeb28d7d2921ba95b32f68235 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Fri, 2 Aug 2013 21:19:05 -0500 Subject: [PATCH] Remove redundant Resolves - ParseExpression() calls Resolve() on the FxExpression before returing it, so there's no need to immediately Resolve() what it returns. --- src/thingdef/thingdef_parse.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/thingdef/thingdef_parse.cpp b/src/thingdef/thingdef_parse.cpp index e4923094e..59c1bcf08 100644 --- a/src/thingdef/thingdef_parse.cpp +++ b/src/thingdef/thingdef_parse.cpp @@ -208,8 +208,6 @@ static void ParseConstant (FScanner &sc, PSymbolTable *symt, PClassActor *cls) FxExpression *expr = ParseExpression (sc, cls); sc.MustGetToken(';'); - FCompileContext ctx(cls); - expr = expr->Resolve(ctx); if (!expr->isConstant()) { sc.ScriptMessage("Constant definition is not a constant"); @@ -266,8 +264,6 @@ static void ParseEnum (FScanner &sc, PSymbolTable *symt, PClassActor *cls) if (sc.CheckToken('=')) { FxExpression *expr = ParseExpression (sc, cls); - FCompileContext ctx(cls); - expr = expr->Resolve(ctx); if (!expr->isConstant()) { sc.ScriptMessage("'%s' must be constant", symname.GetChars()); @@ -355,8 +351,6 @@ static void ParseNativeVariable (FScanner &sc, PSymbolTable *symt, PClassActor * if (sc.CheckToken('[')) { FxExpression *expr = ParseExpression (sc, cls); - FCompileContext ctx(cls); - expr = expr->Resolve(ctx); if (!expr->isConstant()) { sc.ScriptError("Array size must be constant"); @@ -428,9 +422,7 @@ static void ParseUserVariable (FScanner &sc, PSymbolTable *symt, PClassActor *cl if (sc.CheckToken('[')) { FxExpression *expr = ParseExpression(sc, cls); - FCompileContext ctx(cls); int maxelems; - expr = expr->Resolve(ctx); if (!expr->isConstant()) { sc.ScriptMessage("Array size must be a constant");