Skip to content
Snippets Groups Projects
Commit 7b343744 authored by Rafael Espindola's avatar Rafael Espindola
Browse files

Create a std::unique_ptr earlier.

Thanks to David Blaikie for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215865 91177308-0d34-0410-b5e6-96231b3b80d8
parent e4b06e92
Branches
No related tags found
No related merge requests found
......@@ -539,9 +539,9 @@ public:
IntrusiveRefCntPtr<vfs::FileSystem>
getFromYAMLRawString(StringRef Content,
IntrusiveRefCntPtr<vfs::FileSystem> ExternalFS) {
MemoryBuffer *Buffer = MemoryBuffer::getMemBuffer(Content);
return getVFSFromYAML(std::unique_ptr<MemoryBuffer>(Buffer),
CountingDiagHandler, this, ExternalFS);
std::unique_ptr<MemoryBuffer> Buffer(MemoryBuffer::getMemBuffer(Content));
return getVFSFromYAML(std::move(Buffer), CountingDiagHandler, this,
ExternalFS);
}
IntrusiveRefCntPtr<vfs::FileSystem> getFromYAMLString(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment