Author: alexshap Date: Fri Sep 30 16:05:45 2016 New Revision: 282949 URL: http://llvm.org/viewvc/llvm-project?rev=282949&view=rev Log: 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 Modified: cfe/trunk/lib/Tooling/Core/Replacement.cpp Modified: cfe/trunk/lib/Tooling/Core/Replacement.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Core/Replacement.cpp?rev=282949&r1=282948&r2=282949&view=diff ============================================================================== --- cfe/trunk/lib/Tooling/Core/Replacement.cpp (original) +++ cfe/trunk/lib/Tooling/Core/Replacement.cpp Fri Sep 30 16:05:45 2016 @@ -245,7 +245,7 @@ llvm::Error Replacements::add(const Repl 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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits