# HG changeset patch # User Nathan Froyd # Date 1530651867 14400 # Node ID b8e6e7b84ce5b0ed0a402b20f50bc8d2979dce04 # Parent 7e6eabfa350b1c28cc988ed468cbb7d78cb13b01 Bug 1472806 - fix -Wpessimizing-move warnings in Interceptor.cpp; r=aklotz There's no need to invoke std::move here, because Get() is already returning a temporary that can be moved into the RefPtr. diff --git a/ipc/mscom/Interceptor.cpp b/ipc/mscom/Interceptor.cpp --- a/ipc/mscom/Interceptor.cpp +++ b/ipc/mscom/Interceptor.cpp @@ -239,17 +239,17 @@ Interceptor::Create(STAUniquePtr existingWeak(std::move(GetLiveSet().Get(aTarget.get()))); + RefPtr existingWeak(GetLiveSet().Get(aTarget.get())); if (existingWeak) { RefPtr existingStrong; if (SUCCEEDED(existingWeak->ToStrongRef(getter_AddRefs(existingStrong)))) { // QI on existingStrong may touch other threads. Since we now hold a // strong ref on the interceptor, we may now release the lock. lock.Unlock(); return existingStrong->QueryInterface(aInitialIid, aOutInterface); } @@ -886,17 +886,17 @@ Interceptor::Release() Interceptor::DisconnectRemotesForTarget(IUnknown* aTarget) { MOZ_ASSERT(aTarget); detail::LiveSetAutoLock lock(GetLiveSet()); // It is not an error if the interceptor doesn't exist, so we return // S_FALSE instead of an error in that case. - RefPtr existingWeak(std::move(GetLiveSet().Get(aTarget))); + RefPtr existingWeak(GetLiveSet().Get(aTarget)); if (!existingWeak) { return S_FALSE; } RefPtr existingStrong; if (FAILED(existingWeak->ToStrongRef(getter_AddRefs(existingStrong)))) { return S_FALSE; }