Implement and use make_unique

Allows avoiding some explicit calls to new(), which can look suspicious
This commit is contained in:
ridiculousfish
2017-01-21 15:02:41 -08:00
parent 5b108efde4
commit ac8b27fcb1
3 changed files with 10 additions and 5 deletions

View File

@@ -572,9 +572,9 @@ static int string_match(parser_t &parser, io_streams_t &streams, int argc, wchar
std::unique_ptr<string_matcher_t> matcher;
if (regex) {
matcher.reset(new pcre2_matcher_t(argv[0], pattern, opts, streams));
matcher = make_unique<pcre2_matcher_t>(argv[0], pattern, opts, streams);
} else {
matcher.reset(new wildcard_matcher_t(argv[0], pattern, opts, streams));
matcher = make_unique<wildcard_matcher_t>(argv[0], pattern, opts, streams);
}
const wchar_t *arg;