Skip to content

Commit

Permalink
Fix Issue 15995: std.conv.text and friends can be made faster with st…
Browse files Browse the repository at this point in the history
…d.array.appender
  • Loading branch information
JackStouffer committed Jul 12, 2016
1 parent e41d77d commit f678909
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions std/conv.d
Expand Up @@ -3709,17 +3709,23 @@ private S textImpl(S, U...)(U args)
{
return null;
}
else static if (U.length == 1)
{
return to!S(args[0]);
}
else
{
auto result = to!S(args[0]);
foreach (arg; args[1 .. $])
result ~= to!S(arg);
return result;
import std.array : appender;

auto app = appender!S();

foreach (arg; args)
app.put(to!S(arg));
return app.data;
}
}



/***************************************************************
The $(D octal) facility provides a means to declare a number in base 8.
Using $(D octal!177) or $(D octal!"177") for 127 represented in octal
Expand Down

0 comments on commit f678909

Please sign in to comment.