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

Unified Diff: ui/app_list/search/mixer.cc

Issue 898273002: app_list::SearchResult: Duplicate() is const. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix. Created 5 years, 10 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 | « chrome/browser/ui/app_list/search/webstore/webstore_result.cc ('k') | ui/app_list/search/mixer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/search/mixer.cc
diff --git a/ui/app_list/search/mixer.cc b/ui/app_list/search/mixer.cc
index e4ef2f59747981d833f5a525dc546ea54a2b0923..7cb40fd7149aba76693591543974aea5ae1143e4 100644
--- a/ui/app_list/search/mixer.cc
+++ b/ui/app_list/search/mixer.cc
@@ -206,13 +206,13 @@ void Mixer::Publish(const SortedResults& new_results,
// Add items back to |ui_results| in the order of |new_results|.
for (size_t i = 0; i < new_results.size(); ++i) {
- SearchResult* new_result = new_results[i].result;
+ const SearchResult& new_result = *new_results[i].result;
IdToResultMap::const_iterator ui_result_it =
- ui_results_map.find(new_result->id());
+ ui_results_map.find(new_result.id());
if (ui_result_it != ui_results_map.end()) {
// Update and use the old result if it exists.
SearchResult* ui_result = ui_result_it->second;
- UpdateResult(*new_result, ui_result);
+ UpdateResult(new_result, ui_result);
// |ui_results| takes back ownership from |ui_results_map| here.
ui_results->Add(ui_result);
@@ -222,7 +222,7 @@ void Mixer::Publish(const SortedResults& new_results,
ui_results_map.erase(ui_result->id());
} else {
// Copy the result from |new_results| otherwise.
- ui_results->Add(new_result->Duplicate().release());
+ ui_results->Add(new_result.Duplicate().release());
}
}
« no previous file with comments | « chrome/browser/ui/app_list/search/webstore/webstore_result.cc ('k') | ui/app_list/search/mixer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698