From bc8b30c988cf8b471cac0b2bc5cea9fd8594c846 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 7 Dec 2016 13:57:16 +0000 Subject: [PATCH] Replace some string concatenations with a format call --- src/highlighters.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/highlighters.cc b/src/highlighters.cc index 75398039..21b557c4 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -254,14 +254,13 @@ public: { auto colon = find(spec, ':'); if (colon == spec.end()) - throw runtime_error("wrong face spec: '" + spec + - "' expected :"); + throw runtime_error(format("wrong face spec: '{}' expected :", spec)); get_face({colon+1, spec.end()}); // throw if wrong face spec int capture = str_to_int({spec.begin(), colon}); 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};