mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Everywhere: Remove pessimizing and redundant move()
This commit is contained in:
parent
fa28cc85e6
commit
f59ad2dc57
Notes:
sideshowbarker
2024-07-18 21:16:43 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f59ad2dc573
9 changed files with 11 additions and 11 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -231,7 +231,7 @@ OwnPtr<Table> Table::parse(Vector<StringView>::ConstIterator& lines)
|
|||
|
||||
table->m_row_count = row_count;
|
||||
|
||||
return move(table);
|
||||
return table;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue