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) @trusted void error(string msg)
{ {
import std.array : appender; import std.conv : text;
import std.format.write : formattedWrite; string app = msg;
auto app = appender!string(); app ~= "\nPattern with error: `";
formattedWrite(app, "%s\nPattern with error: `%s` <--HERE-- `%s`", app ~= origin[0..$-pat.length].text;
msg, origin[0..$-pat.length], pat); app ~= "` <--HERE-- `";
throw new RegexException(app.data); app ~= pat.text;
app ~= "`";
throw new RegexException(app);
} }
alias Char = BasicElementOf!R; alias Char = BasicElementOf!R;