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

Unified Diff: ios/chrome/browser/voice/speech_input_locale_config_impl.mm

Issue 2945803002: Use ContainsValue() instead of std::find() in ios/ (Closed)
Patch Set: Fixed compilation error. Created 3 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 | « ios/chrome/browser/ui/bookmarks/bookmark_collection_view.mm ('k') | ios/web/webui/url_data_manager_ios.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/voice/speech_input_locale_config_impl.mm
diff --git a/ios/chrome/browser/voice/speech_input_locale_config_impl.mm b/ios/chrome/browser/voice/speech_input_locale_config_impl.mm
index 6a83c23edb70acdedd0f79e7a1c6a7d3733435b9..067da19d16826d064f1c81fda7e0fffa8c4339b8 100644
--- a/ios/chrome/browser/voice/speech_input_locale_config_impl.mm
+++ b/ios/chrome/browser/voice/speech_input_locale_config_impl.mm
@@ -9,6 +9,7 @@
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h"
#include "base/mac/scoped_cftyperef.h"
+#include "base/stl_util.h"
#include "base/strings/string_split.h"
#include "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/voice/speech_input_locale_match_config.h"
@@ -83,9 +84,7 @@ SpeechInputLocaleConfigImpl::GetTextToSpeechLanguages() const {
bool SpeechInputLocaleConfigImpl::IsTextToSpeechEnabledForCode(
const std::string& locale_code) const {
std::string language = GetLanguageComponentForLocaleCode(locale_code);
- auto found_language = std::find(text_to_speech_languages_.begin(),
- text_to_speech_languages_.end(), language);
- return found_language != text_to_speech_languages_.end();
+ return base::ContainsValue(text_to_speech_languages_, language);
}
SpeechInputLocale SpeechInputLocaleConfigImpl::GetMatchingLocale(
« no previous file with comments | « ios/chrome/browser/ui/bookmarks/bookmark_collection_view.mm ('k') | ios/web/webui/url_data_manager_ios.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698