Replace some string concatenations with a format call
This commit is contained in:
parent
1383614a5f
commit
bc8b30c988
|
@ -254,14 +254,13 @@ public:
|
||||||
{
|
{
|
||||||
auto colon = find(spec, ':');
|
auto colon = find(spec, ':');
|
||||||
if (colon == spec.end())
|
if (colon == spec.end())
|
||||||
throw runtime_error("wrong face spec: '" + spec +
|
throw runtime_error(format("wrong face spec: '{}' expected <capture>:<facespec>", spec));
|
||||||
"' expected <capture>:<facespec>");
|
|
||||||
get_face({colon+1, spec.end()}); // throw if wrong face spec
|
get_face({colon+1, spec.end()}); // throw if wrong face spec
|
||||||
int capture = str_to_int({spec.begin(), colon});
|
int capture = str_to_int({spec.begin(), colon});
|
||||||
faces.emplace_back(capture, String{colon+1, spec.end()});
|
faces.emplace_back(capture, String{colon+1, spec.end()});
|
||||||
}
|
}
|
||||||
|
|
||||||
String id = "hlregex'" + params[0] + "'";
|
String id = format("hlregex'{}'", params[0]);
|
||||||
|
|
||||||
Regex ex{params[0], Regex::optimize};
|
Regex ex{params[0], Regex::optimize};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user