Chromium Code Reviews| Index: components/omnibox/autocomplete_result.cc |
| diff --git a/components/omnibox/autocomplete_result.cc b/components/omnibox/autocomplete_result.cc |
| index 5d7c42c3a3ce1f0a84c7555e08d2b2ffd6febe13..ca61ba68a0b83f1ce0f23ae2dbe32b9cf8c79033 100644 |
| --- a/components/omnibox/autocomplete_result.cc |
| +++ b/components/omnibox/autocomplete_result.cc |
| @@ -161,15 +161,17 @@ void AutocompleteResult::CopyOldMatches( |
| SortAndCull(input, template_url_service); |
| } |
| -void AutocompleteResult::AppendMatches(const ACMatches& matches) { |
| -#ifndef NDEBUG |
| +void AutocompleteResult::AppendMatches(const AutocompleteInput& input, |
| + const ACMatches& matches) { |
| for (ACMatches::const_iterator i(matches.begin()); i != matches.end(); ++i) { |
|
Peter Kasting
2015/05/22 23:39:36
Nit: Range-based for?
Mark P
2015/05/23 20:32:13
Okay. Done.
|
| +#ifndef NDEBUG |
| DCHECK_EQ(AutocompleteMatch::SanitizeString(i->contents), i->contents); |
| DCHECK_EQ(AutocompleteMatch::SanitizeString(i->description), |
| i->description); |
| - } |
| #endif |
| - std::copy(matches.begin(), matches.end(), std::back_inserter(matches_)); |
| + matches_.push_back(*i); |
| + matches_.back().PossiblySwapContentsAndDescriptionForURLSuggestion(input); |
| + } |
| default_match_ = end(); |
| alternate_nav_url_ = GURL(); |
| } |