Skip to content

Commit 1e1f070

Browse files
committed
Dramatically faster to compile Tuple
1 parent ea1e9b2 commit 1e1f070

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

std/typecons.d

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,14 +535,14 @@ if (distinctFieldNames!(Specs))
535535
string injectNamedFields()
536536
{
537537
string decl = "";
538+
import std.conv : to;
538539
foreach (i, name; staticMap!(extractName, fieldSpecs))
539540
{
540-
import std.format : format;
541-
542-
decl ~= format("alias _%s = Identity!(field[%s]);", i, i);
541+
auto si = to!string(i);
542+
decl ~= "alias _" ~ si ~ " = Identity!(field[" ~ si ~ "]);";
543543
if (name.length != 0)
544544
{
545-
decl ~= format("alias %s = _%s;", name, i);
545+
decl ~= "alias " ~ name ~ " = _" ~ si ~ ";";
546546
}
547547
}
548548
return decl;

0 commit comments

Comments
 (0)