diff --git a/example/calculator.cpp b/example/calculator.cpp index 956a5d60..65f6476e 100644 --- a/example/calculator.cpp +++ b/example/calculator.cpp @@ -30,9 +30,9 @@ class InitImpl : public Init } }; -void LogPrint(bool raise, std::string message) +void LogPrint(bool raise, const std::string& message) { - if (raise) throw std::runtime_error(std::move(message)); + if (raise) throw std::runtime_error(message); std::ofstream("debug.log", std::ios_base::app) << message << std::endl; } diff --git a/example/example.cpp b/example/example.cpp index 3c8a7479..ecaabafb 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -23,9 +23,9 @@ auto Spawn(mp::EventLoop& loop, const std::string& process_argv0, const std::str return std::make_tuple(mp::ConnectStream(loop, fd), pid); } -void LogPrint(bool raise, std::string message) +void LogPrint(bool raise, const std::string& message) { - if (raise) throw std::runtime_error(std::move(message)); + if (raise) throw std::runtime_error(message); std::ofstream("debug.log", std::ios_base::app) << message << std::endl; } diff --git a/example/printer.cpp b/example/printer.cpp index f24f60c2..0a51cdd4 100644 --- a/example/printer.cpp +++ b/example/printer.cpp @@ -24,9 +24,9 @@ class InitImpl : public Init std::unique_ptr makePrinter() override { return std::make_unique(); } }; -void LogPrint(bool raise, std::string message) +void LogPrint(bool raise, const std::string& message) { - if (raise) throw std::runtime_error(std::move(message)); + if (raise) throw std::runtime_error(message); std::ofstream("debug.log", std::ios_base::app) << message << std::endl; } diff --git a/include/mp/proxy-types.h b/include/mp/proxy-types.h index 4679f8d2..902bd240 100644 --- a/include/mp/proxy-types.h +++ b/include/mp/proxy-types.h @@ -159,7 +159,7 @@ auto PassField(Priority<1>, TypeList<>, ServerContext& server_context, const Fn& auto thread_client = context_arg.getThread(); return JoinPromises(server.m_context.connection->m_threads.getLocalServer(thread_client) - .then([&server, invoke, req](kj::Maybe perhaps) { + .then([&server, invoke, req](const kj::Maybe& perhaps) { KJ_IF_MAYBE(thread_server, perhaps) { const auto& thread = static_cast&>(*thread_server);