unsignedToTempString: use the template version

This commit is contained in:
Andrei Alexandrescu 2020-07-26 14:24:31 -04:00 committed by The Dlang Bot
parent b65799a8e7
commit 05c79e1af1
3 changed files with 5 additions and 5 deletions

View file

@ -5790,12 +5790,12 @@ if (isIntegral!T && isOutputRange!(W, char))
if (value < 0) if (value < 0)
{ {
SignedStringBuf buf = void; SignedStringBuf buf = void;
put(writer, signedToTempString(value, buf, 10)); put(writer, signedToTempString(value, buf));
} }
else else
{ {
UnsignedStringBuf buf = void; UnsignedStringBuf buf = void;
put(writer, unsignedToTempString(value, buf, 10)); put(writer, unsignedToTempString(value, buf));
} }
} }

View file

@ -929,7 +929,7 @@ Parameters for the generator.
UnsignedStringBuf buf = void; UnsignedStringBuf buf = void;
string s = "MersenneTwisterEngine.seed: Input range didn't provide enough elements: Need "; string s = "MersenneTwisterEngine.seed: Input range didn't provide enough elements: Need ";
s ~= unsignedToTempString(n, buf, 10) ~ " elements."; s ~= unsignedToTempString(n, buf) ~ " elements.";
throw new Exception(s); throw new Exception(s);
} }

View file

@ -107,7 +107,7 @@ class UTFException : UnicodeException
size_t line = __LINE__, Throwable next = null) @safe pure nothrow size_t line = __LINE__, Throwable next = null) @safe pure nothrow
{ {
UnsignedStringBuf buf = void; UnsignedStringBuf buf = void;
msg ~= " (at index " ~ unsignedToTempString(index, buf, 10) ~ ")"; msg ~= " (at index " ~ unsignedToTempString(index, buf) ~ ")";
super(msg, index, file, line, next); super(msg, index, file, line, next);
} }
@ -133,7 +133,7 @@ class UTFException : UnicodeException
{ {
UnsignedStringBuf buf = void; UnsignedStringBuf buf = void;
result ~= ' '; result ~= ' ';
auto h = unsignedToTempString(i, buf, 16); auto h = unsignedToTempString!16(i, buf);
if (h.length == 1) if (h.length == 1)
result ~= '0'; result ~= '0';
result ~= h; result ~= h;