File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -486,7 +486,7 @@ void RegisterProfilerManager(ProfilerManager* profiler_manager);
486486
487487// Add a key-value pair to output as part of the context stanza in the report.
488488BENCHMARK_EXPORT
489- void AddCustomContext (const std::string& key, const std::string& value);
489+ void AddCustomContext (std::string key, std::string value);
490490
491491namespace internal {
492492class Benchmark ;
Original file line number Diff line number Diff line change @@ -708,11 +708,12 @@ void RegisterProfilerManager(ProfilerManager* manager) {
708708 internal::profiler_manager = manager;
709709}
710710
711- void AddCustomContext (const std::string& key, const std::string& value) {
711+ void AddCustomContext (std::string key, std::string value) {
712712 if (internal::global_context == nullptr ) {
713713 internal::global_context = new std::map<std::string, std::string>();
714714 }
715- if (!internal::global_context->emplace (key, value).second ) {
715+ if (!internal::global_context->emplace (std::move (key), std::move (value))
716+ .second ) {
716717 std::cerr << " Failed to add custom context \" " << key << " \" as it already "
717718 << " exists with value \" " << value << " \"\n " ;
718719 }
You can’t perform that action at this time.
0 commit comments