Skip to content

Commit

Permalink
10% faster compile for std.algorithm
Browse files Browse the repository at this point in the history
by fixing incredibly slow Tuple code.
  • Loading branch information
don-clugston-sociomantic committed Dec 11, 2012
1 parent 24b7d42 commit 5ef89e6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions std/typecons.d
Expand Up @@ -323,12 +323,11 @@ private:
string decl = "";
foreach (i, name; staticMap!(extractName, fieldSpecs))
{
enum field = Format!("Identity!(field[%s])",i);
enum numbered = Format!("_%s", i);
decl ~= Format!("alias %s %s;", field, numbered);
enum numbered = toStringNow!(i);
decl ~= "alias Identity!(field[" ~ numbered ~ "]) _" ~ numbered ~ ";";
if (name.length != 0)
{
decl ~= Format!("alias %s %s;", numbered, name);
decl ~= "alias _" ~ numbered ~ " " ~ name ~ ";";
}
}
return decl;
Expand Down

0 comments on commit 5ef89e6

Please sign in to comment.