Skip to content

Commit

Permalink
[Refactoring] Remove redundant argument setting
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Feb 26, 2013
1 parent e9f4bd1 commit 5bc2f52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/expression.c
Original file line number Diff line number Diff line change
Expand Up @@ -7995,9 +7995,6 @@ Expression *CallExp::semantic(Scope *sc)
{ dte = (DotTemplateExp *)(e1);
TemplateDeclaration *td = dte->td;
assert(td);
if (!arguments)
// Should fix deduceFunctionTemplate() so it works on NULL argument
arguments = new Expressions();
f = td->deduceFunctionTemplate(loc, sc, targsi, ue1, arguments);
if (!f)
return new ErrorExp();
Expand Down
4 changes: 2 additions & 2 deletions src/template.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ MATCH TemplateDeclaration::deduceFunctionTemplateMatch(Loc loc, Scope *sc, Objec

#if 0
printf("\nTemplateDeclaration::deduceFunctionTemplateMatch() %s\n", toChars());
for (size_t i = 0; i < fargs->dim; i++)
for (size_t i = 0; i < (fargs ? fargs->dim : 0); i++)
{ Expression *e = (*fargs)[i];
printf("\tfarg[%d] is %s, type is %s\n", i, e->toChars(), e->type->toChars());
}
Expand Down Expand Up @@ -2028,7 +2028,7 @@ FuncDeclaration *TemplateDeclaration::deduceFunctionTemplate(Loc loc, Scope *sc,
}
}
printf(" fargs:\n");
for (size_t i = 0; i < fargs->dim; i++)
for (size_t i = 0; i < (fargs ? fargs->dim : 0); i++)
{ Expression *arg = (*fargs)[i];
printf("\t%s %s\n", arg->type->toChars(), arg->toChars());
//printf("\tty = %d\n", arg->type->ty);
Expand Down

0 comments on commit 5bc2f52

Please sign in to comment.