Bug 1611415 - Prefer using std::move over forget. r=froydnj

Differential Revision: https://phabricator.services.mozilla.com/D60980
This commit is contained in:
Simon Giesecke
2020-02-13 14:38:48 +00:00
parent 4394df52a7
commit 9bcfd47601
251 changed files with 512 additions and 500 deletions

View File

@@ -895,7 +895,7 @@ nsresult nsHtml5StreamParser::WriteStreamBytes(
MarkAsBroken(NS_ERROR_OUT_OF_MEMORY);
return NS_ERROR_OUT_OF_MEMORY;
}
mLastBuffer = (mLastBuffer->next = newBuf.forget());
mLastBuffer = (mLastBuffer->next = std::move(newBuf));
} else {
MOZ_ASSERT(totalRead == aFromSegment.Length(),
"The Unicode decoder consumed the wrong number of bytes.");
@@ -1279,7 +1279,7 @@ void nsHtml5StreamParser::DoStopRequest() {
MarkAsBroken(NS_ERROR_OUT_OF_MEMORY);
return;
}
mLastBuffer = (mLastBuffer->next = newBuf.forget());
mLastBuffer = (mLastBuffer->next = std::move(newBuf));
} else {
if (mDecodingLocalFileWithoutTokenizing) {
MOZ_ASSERT(mLocalFileBytesBuffered < LOCAL_FILE_UTF_8_BUFFER_SIZE);