use make_shared where appropriate
This commit is contained in:
@@ -14,7 +14,7 @@ FileContentsCache::File::File(
|
||||
string&& data,
|
||||
uint64_t load_time)
|
||||
: name(name),
|
||||
data(new string(std::move(data))),
|
||||
data(make_shared<string>(std::move(data))),
|
||||
load_time(load_time) {}
|
||||
|
||||
shared_ptr<const FileContentsCache::File> FileContentsCache::replace(
|
||||
@@ -22,7 +22,7 @@ shared_ptr<const FileContentsCache::File> FileContentsCache::replace(
|
||||
if (t == 0) {
|
||||
t = now();
|
||||
}
|
||||
shared_ptr<File> new_file(new File(name, std::move(data), t));
|
||||
auto new_file = make_shared<File>(name, std::move(data), t);
|
||||
auto emplace_ret = this->name_to_file.emplace(name, new_file);
|
||||
if (!emplace_ret.second) {
|
||||
emplace_ret.first->second = new_file;
|
||||
|
||||
Reference in New Issue
Block a user