Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Unified Diff: base/tracked_objects.cc

Issue 155022: Fix few trivial Coverity issues, mainly PASS_BY_VALUE. (Closed)
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/tracked_objects.h ('k') | net/base/x509_certificate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/tracked_objects.cc
diff --git a/base/tracked_objects.cc b/base/tracked_objects.cc
index a97f014b519d2ab1e292a46217067a296c9ede1c..1e7d293a3d78d879c719edfd213302f82f811f58 100644
--- a/base/tracked_objects.cc
+++ b/base/tracked_objects.cc
@@ -765,7 +765,7 @@ bool Comparator::Acceptable(const Snapshot& sample) const {
return true;
}
-void Comparator::SetTiebreaker(Selector selector, const std::string required) {
+void Comparator::SetTiebreaker(Selector selector, const std::string& required) {
if (selector == selector_ || NIL == selector)
return;
combined_selectors_ |= selector;
@@ -804,7 +804,7 @@ void Comparator::SetSubgroupTiebreaker(Selector selector) {
}
}
-void Comparator::ParseKeyphrase(const std::string key_phrase) {
+void Comparator::ParseKeyphrase(const std::string& key_phrase) {
static std::map<const std::string, Selector> key_map;
static bool initialized = false;
if (!initialized) {
@@ -829,7 +829,7 @@ void Comparator::ParseKeyphrase(const std::string key_phrase) {
SetTiebreaker(key_map[keyword], required);
}
-bool Comparator::ParseQuery(const std::string query) {
+bool Comparator::ParseQuery(const std::string& query) {
for (size_t i = 0; i < query.size();) {
size_t slash_offset = query.find('/', i);
ParseKeyphrase(query.substr(i, slash_offset - i));
« no previous file with comments | « base/tracked_objects.h ('k') | net/base/x509_certificate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698