Remove some calls to std::move.

Instead of moving out the data in a ErrorOr<std::unique_ptr<Foo>>, get
a reference to it.

Thanks to David Blaikie for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214516 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-08-01 14:31:55 +00:00
parent a36429f26d
commit 9aa0b5e11e
19 changed files with 65 additions and 66 deletions

View File

@ -39,11 +39,11 @@ LockFileManager::readLockFile(StringRef LockFileName) {
sys::fs::remove(LockFileName);
return None;
}
std::unique_ptr<MemoryBuffer> MB = std::move(MBOrErr.get());
MemoryBuffer &MB = *MBOrErr.get();
StringRef Hostname;
StringRef PIDStr;
std::tie(Hostname, PIDStr) = getToken(MB->getBuffer(), " ");
std::tie(Hostname, PIDStr) = getToken(MB.getBuffer(), " ");
PIDStr = PIDStr.substr(PIDStr.find_first_not_of(" "));
int PID;
if (!PIDStr.getAsInteger(10, PID)) {