Skip to content

Commit

Permalink
Common/Analytics: std::move std::string constructor parameter
Browse files Browse the repository at this point in the history
Allows calling code to move into the constructor, avoiding the creation
of another string copy.
  • Loading branch information
lioncash committed Jun 4, 2019
1 parent f813c49 commit 58e2cd5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/Core/Common/Analytics.cpp
Expand Up @@ -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))
{
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Common/Analytics.h
Expand Up @@ -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;
Expand Down

0 comments on commit 58e2cd5

Please sign in to comment.