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

Unified Diff: components/translate/core/browser/language_model.h

Issue 2449873003: [NTP Snippets] Another round of clang-tidy cleanups (Closed)
Patch Set: review Created 4 years, 2 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
Index: components/translate/core/browser/language_model.h
diff --git a/components/translate/core/browser/language_model.h b/components/translate/core/browser/language_model.h
index c06caac1144344e68315ede6da72965f5bfe0a17..fa40690c3f36430f0720b1699235be9e2868c493 100644
--- a/components/translate/core/browser/language_model.h
+++ b/components/translate/core/browser/language_model.h
@@ -24,6 +24,10 @@ namespace translate {
class LanguageModel : public KeyedService {
public:
struct LanguageInfo {
+ LanguageInfo() = default;
Bernhard Bauer 2016/10/26 09:24:02 So, is there a rule for when to use {} and when to
Marc Treib 2016/10/26 09:29:40 I don't know of any "official" rule - my personal
+ LanguageInfo(const std::string& language_code, float frequency)
+ : language_code(language_code), frequency(frequency) {}
+
// The ISO 639 language code.
std::string language_code;
@@ -31,7 +35,7 @@ class LanguageModel : public KeyedService {
// and 1 (can be understood as the probability that the next page the user
// opens is in this language). Frequencies over all LanguageInfos from
// GetTopLanguages() sum to 1 (unless there are no top languages, yet).
- float frequency;
+ float frequency = 0.0f;
Marc Treib 2016/10/26 09:21:05 Uninitialized values are Teh Evilz! :) Unfortunate
bool operator==(const LanguageInfo& m) const {
return language_code == m.language_code;
« no previous file with comments | « components/ntp_snippets/remote/ntp_snippets_fetcher.cc ('k') | components/translate/core/browser/language_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698