Chromium Code Reviews| Index: base/i18n/timezone.cc |
| diff --git a/base/i18n/timezone.cc b/base/i18n/timezone.cc |
| index 8c652799dbb9c231cc1a08e119bfedd99409023f..41219373b18a7fddf7c1b0662bef6b5cb451a17b 100644 |
| --- a/base/i18n/timezone.cc |
| +++ b/base/i18n/timezone.cc |
| @@ -35,9 +35,10 @@ class TimezoneMap { |
| // <http://www.ietf.org/timezones/data/zone.tab> and is a part of public |
| // domain. |
| struct OlsonCodeData { |
| - std::string country_code; |
| - std::string olson_code; |
| - } olson_code_data[] = { |
| + const char* country_code; |
| + const char* olson_code; |
| + }; |
| + static const OlsonCodeData olson_code_data[] = { |
| { "AD", "Europe/Andorra" }, |
| { "AE", "Asia/Dubai" }, |
| { "AF", "Asia/Kabul" }, |
| @@ -460,16 +461,18 @@ class TimezoneMap { |
| }; |
| for (size_t i = 0; i < ARRAYSIZE_UNSAFE(olson_code_data); ++i) { |
|
Mark Mentovai
2014/10/01 13:05:07
This can be normal arraysize now. Same below.
Daniel Bratell
2014/10/01 19:56:22
Done.
|
| - map_[olson_code_data[i].olson_code] = olson_code_data[i].country_code; |
| + map_[std::string(olson_code_data[i].olson_code)] = |
| + std::string(olson_code_data[i].country_code); |
|
Mark Mentovai
2014/10/01 13:05:07
You can make the “value” side of the map store con
Daniel Bratell
2014/10/01 19:56:22
Done.
|
| } |
| // These are mapping from old codenames to new codenames. They are also |
| // part of public domain, and available at |
| // <http://www.ietf.org/timezones/data/backward>. |
| struct LinkData { |
| - std::string old_code; |
| - std::string new_code; |
| - } link_data[] = { |
| + const char* old_code; |
| + const char* new_code; |
| + }; |
| + static const LinkData link_data[] = { |
| { "Africa/Asmera", "Africa/Asmara" }, |
| { "Africa/Timbuktu", "Africa/Bamako" }, |
| { "America/Argentina/ComodRivadavia", "America/Argentina/Catamarca" }, |
| @@ -583,7 +586,8 @@ class TimezoneMap { |
| }; |
| for (size_t i = 0; i < ARRAYSIZE_UNSAFE(link_data); ++i) { |
| - map_[link_data[i].old_code] = map_[link_data[i].new_code]; |
| + map_[std::string(link_data[i].old_code)] = |
| + map_[std::string(link_data[i].new_code)]; |
| } |
| } |