[llvm] dd63ede - [llvm][NFC] Remove redundant copy parameter (#109859)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 09:18:27 PDT 2024


Author: Amr Hesham
Date: 2024-10-15T18:18:24+02:00
New Revision: dd63ede2f548dc70b74ad2040a95f45cf5aa94a4

URL: https://github.com/llvm/llvm-project/commit/dd63ede2f548dc70b74ad2040a95f45cf5aa94a4
DIFF: https://github.com/llvm/llvm-project/commit/dd63ede2f548dc70b74ad2040a95f45cf5aa94a4.diff

LOG: [llvm][NFC] Remove redundant copy parameter (#109859)

Remove redundant copy parameter and move it

from `explicit OwningMemoryBlock(MemoryBlock M) : M(M) {}`

to `explicit OwningMemoryBlock(MemoryBlock M) : M(std::move(m)) {}`

Fixes: #95640

Added: 
    

Modified: 
    llvm/include/llvm/Support/Memory.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/Memory.h b/llvm/include/llvm/Support/Memory.h
index d7d60371d315f0..c02a3cc14dc7de 100644
--- a/llvm/include/llvm/Support/Memory.h
+++ b/llvm/include/llvm/Support/Memory.h
@@ -137,7 +137,7 @@ namespace sys {
   class OwningMemoryBlock {
   public:
     OwningMemoryBlock() = default;
-    explicit OwningMemoryBlock(MemoryBlock M) : M(M) {}
+    explicit OwningMemoryBlock(MemoryBlock M) : M(std::move(M)) {}
     OwningMemoryBlock(OwningMemoryBlock &&Other) {
       M = Other.M;
       Other.M = MemoryBlock();


        


More information about the llvm-commits mailing list