Skip to content

Commit

Permalink
Cleanup: Pass std::string as const reference from chrome_elf/
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=caitkp@chromium.org,robertshield@chromium.org

Review URL: https://codereview.chromium.org/1352793003

Cr-Commit-Position: refs/heads/master@{#349887}
  • Loading branch information
k15tfu authored and Commit bot committed Sep 20, 2015
1 parent 9124692 commit b3289e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chrome_elf/dll_hash/dll_hash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "base/hash.h"
#include "chrome_elf/dll_hash/dll_hash.h"

int DllNameToHash(std::string dll_name) {
int DllNameToHash(const std::string& dll_name) {
uint32 data = base::Hash(dll_name);

// Strip off the signed bit because UMA doesn't support negative values,
Expand Down
2 changes: 1 addition & 1 deletion chrome_elf/dll_hash/dll_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
#include <string>

// Convert a dll name to a hash that can be sent via UMA.
int DllNameToHash(std::string dll_name);
int DllNameToHash(const std::string& dll_name);

#endif // CHROME_ELF_DLL_HASH_DLL_HASH_H_

0 comments on commit b3289e3

Please sign in to comment.