Explorar o código

Everywhere: Remove pessimizing and redundant move()

Andreas Kling %!s(int64=4) %!d(string=hai) anos
pai
achega
f59ad2dc57

+ 1 - 1
AK/Tests/TestNeverDestroyed.cpp

@@ -58,7 +58,7 @@ TEST_CASE(should_construct_by_copy)
 TEST_CASE(should_construct_by_move)
 {
     Counter c {};
-    AK::NeverDestroyed<Counter> n { AK::move(c) };
+    AK::NeverDestroyed<Counter> n { move(c) };
 
     EXPECT_EQ(0, n->num_copies);
     EXPECT_EQ(1, n->num_moves);

+ 2 - 2
AK/TypedTransfer.h

@@ -45,9 +45,9 @@ public:
 
         for (size_t i = 0; i < count; ++i) {
             if (destination <= source)
-                new (&destination[i]) T(AK::move(source[i]));
+                new (&destination[i]) T(std::move(source[i]));
             else
-                new (&destination[count - i - 1]) T(AK::move(source[count - i - 1]));
+                new (&destination[count - i - 1]) T(std::move(source[count - i - 1]));
         }
 
         return;

+ 1 - 1
Userland/DevTools/HackStudio/LanguageServers/Cpp/ParserAutoComplete.cpp

@@ -75,7 +75,7 @@ OwnPtr<ParserAutoComplete::DocumentData> ParserAutoComplete::create_document_dat
 
     update_declared_symbols(*document_data);
 
-    return move(document_data);
+    return document_data;
 }
 
 void ParserAutoComplete::set_document_data(const String& file, OwnPtr<DocumentData>&& data)

+ 1 - 1
Userland/DevTools/HackStudio/LanguageServers/Shell/AutoComplete.cpp

@@ -67,7 +67,7 @@ OwnPtr<AutoComplete::DocumentData> AutoComplete::create_document_data_for(const
         get_or_create_document_data(path);
 
     update_declared_symbols(*document_data);
-    return move(document_data);
+    return document_data;
 }
 
 void AutoComplete::set_document_data(const String& file, OwnPtr<DocumentData>&& data)

+ 1 - 1
Userland/Libraries/LibDebug/DebugSession.cpp

@@ -120,7 +120,7 @@ OwnPtr<DebugSession> DebugSession::exec_and_attach(const String& command, String
     // At this point, libraries should have been loaded
     debug_session->update_loaded_libs();
 
-    return move(debug_session);
+    return debug_session;
 }
 
 bool DebugSession::poke(u32* address, u32 data)

+ 1 - 1
Userland/Libraries/LibImageDecoderClient/Client.cpp

@@ -78,7 +78,7 @@ Optional<DecodedImage> Client::decode_image(const ByteBuffer& encoded_data)
         frame.bitmap = response->bitmaps()[i].bitmap();
         frame.duration = response->durations()[i];
     }
-    return move(image);
+    return image;
 }
 
 }

+ 1 - 1
Userland/Libraries/LibMarkdown/Table.cpp

@@ -231,7 +231,7 @@ OwnPtr<Table> Table::parse(Vector<StringView>::ConstIterator& lines)
 
     table->m_row_count = row_count;
 
-    return move(table);
+    return table;
 }
 
 }

+ 2 - 2
Userland/Services/LookupServer/LookupServer.cpp

@@ -203,7 +203,7 @@ Vector<DNSAnswer> LookupServer::lookup(const DNSName& name, unsigned short recor
         return {};
     }
 
-    return move(answers);
+    return answers;
 }
 
 Vector<DNSAnswer> LookupServer::lookup(const DNSName& name, const String& nameserver, bool& did_get_response, unsigned short record_type, ShouldRandomizeCase should_randomize_case)
@@ -296,7 +296,7 @@ Vector<DNSAnswer> LookupServer::lookup(const DNSName& name, const String& namese
         answers.append(answer);
     }
 
-    return move(answers);
+    return answers;
 }
 
 void LookupServer::put_in_cache(const DNSAnswer& answer)

+ 1 - 1
Userland/Shell/Parser.cpp

@@ -1239,7 +1239,7 @@ RefPtr<AST::Node> Parser::parse_string()
         auto result = create<AST::StringLiteral>(move(text)); // String Literal
         if (is_error)
             result->set_is_syntax_error(*create<AST::SyntaxError>("Expected a terminating single quote", true));
-        return move(result);
+        return result;
     }
 
     return nullptr;