From: Alexander Shaposhnikov Date: Fri, 30 Sep 2016 21:05:45 +0000 (+0000) Subject: Add missing std::move in Replacements::add X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b53de5451df80bde0b66f3ce1e7e5b3b2dd44406;p=clang Add missing std::move in Replacements::add This diff adds std::move to avoid copying of the Replacement NewR in the method Replacements::add. Test plan: make -j8 check-all Differential revision: https://reviews.llvm.org/D25049 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282949 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Tooling/Core/Replacement.cpp b/lib/Tooling/Core/Replacement.cpp index 7a5fb856ae..bdca474015 100644 --- a/lib/Tooling/Core/Replacement.cpp +++ b/lib/Tooling/Core/Replacement.cpp @@ -245,7 +245,7 @@ llvm::Error Replacements::add(const Replacement &R) { R.getFilePath(), R.getOffset(), 0, (R.getReplacementText() + I->getReplacementText()).str()); Replaces.erase(I); - Replaces.insert(NewR); + Replaces.insert(std::move(NewR)); return llvm::Error::success(); } // Insertion `R` is adjacent to a non-insertion replacement `I`, so they