Skip to content

Commit

Permalink
Cleanup: Pass std::string as const reference from testing/
Browse files Browse the repository at this point in the history
Passing std::string by reference can prevent extra copying of object.

BUG=367418
TEST=
R=phajdan.jr@chromium.org

Review-Url: https://codereview.chromium.org/2001093008
Cr-Commit-Position: refs/heads/master@{#396030}
  • Loading branch information
k15tfu authored and Commit bot committed May 25, 2016
1 parent d1a23ec commit a690281
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion testing/multiprocess_func_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ AppendMultiProcessTest::AppendMultiProcessTest(
ProcessFunctions(main_func_ptr, setup_func_ptr);
}

int InvokeChildProcessTest(std::string test_name) {
int InvokeChildProcessTest(const std::string& test_name) {
MultiProcessTestMap& func_lookup_table = GetMultiprocessFuncMap();
MultiProcessTestMap::iterator it = func_lookup_table.find(test_name);
if (it != func_lookup_table.end()) {
Expand Down
2 changes: 1 addition & 1 deletion testing/multiprocess_func_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class AppendMultiProcessTest {

// Invoke the main function of a test previously registered with
// MULTIPROCESS_TEST_MAIN()
int InvokeChildProcessTest(std::string test_name);
int InvokeChildProcessTest(const std::string& test_name);

// This macro creates a global MultiProcessTest::AppendMultiProcessTest object
// whose constructor does the work of adding the global mapping.
Expand Down

0 comments on commit a690281

Please sign in to comment.