Improve std.regex build times by removing a formattedWrite call

This commit is contained in:
richard (rikki) andrew cattermole 2023-02-25 02:21:51 +13:00
parent a33d048302
commit ff86bb0d70

View file

@ -1010,12 +1010,14 @@ if (isForwardRange!R && is(ElementType!R : dchar))
//
@trusted void error(string msg)
{
import std.array : appender;
import std.format.write : formattedWrite;
auto app = appender!string();
formattedWrite(app, "%s\nPattern with error: `%s` <--HERE-- `%s`",
msg, origin[0..$-pat.length], pat);
throw new RegexException(app.data);
import std.conv : text;
string app = msg;
app ~= "\nPattern with error: `";
app ~= origin[0..$-pat.length].text;
app ~= "` <--HERE-- `";
app ~= pat.text;
app ~= "`";
throw new RegexException(app);
}
alias Char = BasicElementOf!R;