From d307e645b15d0c47ef8e5be15b11e7f19331abb0 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sun, 2 Oct 2016 18:39:10 -1000 Subject: [PATCH] Remove unnecessary and RVO-detrimental moves --- hecl/lib/Frontend/Lexer.cpp | 16 ++++++++-------- hecl/lib/hecl.cpp | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hecl/lib/Frontend/Lexer.cpp b/hecl/lib/Frontend/Lexer.cpp index 8ec3c261d..f1f014d6e 100644 --- a/hecl/lib/Frontend/Lexer.cpp +++ b/hecl/lib/Frontend/Lexer.cpp @@ -168,8 +168,8 @@ void Lexer::consumeAllTokens(Parser& parser) m_diag.reportLexerErr(n->m_next->m_tok.m_location, "empty function arg"); return; } - m_pool.emplace_front(std::move( - Parser::Token(Parser::TokenType::EvalGroupStart, n->m_next->m_tok.m_location))); + m_pool.emplace_front( + Parser::Token(Parser::TokenType::EvalGroupStart, n->m_next->m_tok.m_location)); Lexer::OperationNode* grp = &m_pool.front(); grp->m_next = n->m_next; grp->m_prev = n; @@ -181,8 +181,8 @@ void Lexer::consumeAllTokens(Parser& parser) { if (n->m_prev->m_tok.m_type != Parser::TokenType::FunctionStart) { - m_pool.emplace_front(std::move( - Parser::Token(Parser::TokenType::EvalGroupEnd, n->m_tok.m_location))); + m_pool.emplace_front( + Parser::Token(Parser::TokenType::EvalGroupEnd, n->m_tok.m_location)); Lexer::OperationNode* grp = &m_pool.front(); grp->m_next = n; grp->m_prev = n->m_prev; @@ -199,12 +199,12 @@ void Lexer::consumeAllTokens(Parser& parser) return; } - m_pool.emplace_front(std::move( - Parser::Token(Parser::TokenType::EvalGroupEnd, n->m_tok.m_location))); + m_pool.emplace_front( + Parser::Token(Parser::TokenType::EvalGroupEnd, n->m_tok.m_location)); Lexer::OperationNode* egrp = &m_pool.front(); - m_pool.emplace_front(std::move( - Parser::Token(Parser::TokenType::EvalGroupStart, n->m_next->m_tok.m_location))); + m_pool.emplace_front( + Parser::Token(Parser::TokenType::EvalGroupStart, n->m_next->m_tok.m_location)); Lexer::OperationNode* sgrp = &m_pool.front(); egrp->m_next = sgrp; diff --git a/hecl/lib/hecl.cpp b/hecl/lib/hecl.cpp index d2ad43971..3e093e513 100644 --- a/hecl/lib/hecl.cpp +++ b/hecl/lib/hecl.cpp @@ -334,7 +334,7 @@ hecl::DirectoryEnumerator::DirectoryEnumerator(const hecl::SystemChar* path, Mod else continue; - m_entries.push_back(std::move(Entry(std::move(fp), d->d_name, sz, isDir))); + m_entries.push_back(Entry(std::move(fp), d->d_name, sz, isDir)); } break; case Mode::DirsThenFilesSorted: