mirror of
https://github.com/dlang/phobos.git
synced 2025-04-27 21:51:40 +03:00
Improve std.regex build times by removing a formattedWrite call
This commit is contained in:
parent
a33d048302
commit
ff86bb0d70
1 changed files with 8 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue