Skip to content
Permalink
Browse files

Common/Analytics: std::move std::string constructor parameter

Allows calling code to move into the constructor, avoiding the creation
of another string copy.
  • Loading branch information...
lioncash committed Jun 3, 2019
1 parent f813c49 commit 58e2cd54866572b48e422733b3112c58f7cce3a7
Showing with 2 additions and 2 deletions.
  1. +1 −1 Source/Core/Common/Analytics.cpp
  2. +1 −1 Source/Core/Common/Analytics.h
@@ -198,7 +198,7 @@ void StdoutAnalyticsBackend::Send(std::string report)
HexDump(reinterpret_cast<const u8*>(report.data()), report.size()).c_str());
}

HttpAnalyticsBackend::HttpAnalyticsBackend(const std::string& endpoint) : m_endpoint(endpoint)
HttpAnalyticsBackend::HttpAnalyticsBackend(std::string endpoint) : m_endpoint(std::move(endpoint))
{
}

@@ -184,7 +184,7 @@ class StdoutAnalyticsBackend : public AnalyticsReportingBackend
class HttpAnalyticsBackend : public AnalyticsReportingBackend
{
public:
HttpAnalyticsBackend(const std::string& endpoint);
explicit HttpAnalyticsBackend(std::string endpoint);
~HttpAnalyticsBackend() override;

void Send(std::string report) override;

0 comments on commit 58e2cd5

Please sign in to comment.
You can’t perform that action at this time.