Skip to content

Commit

Permalink
Merge pull request #4280 from JackStouffer/textImpl
Browse files Browse the repository at this point in the history
Small performance increase for std.conv.text/wtext/dtext
  • Loading branch information
schveiguy committed Jul 14, 2016
2 parents 2443331 + f678909 commit c9df29e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions std/conv.d
Expand Up @@ -3710,17 +3710,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 c9df29e

Please sign in to comment.