diff options
author | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-08-04 14:20:13 +0300 |
---|---|---|
committer | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-08-13 13:32:56 +0300 |
commit | 03bb17f8c506164efa39708cd2caea7aa11403f7 (patch) | |
tree | 5a469abca527c39e3714e7f65ec110ca8328b78a | |
parent | e6e751abd3cd785f02b3f691f52d1a4db00afdb8 (diff) | |
download | qtlocation-mapboxgl-03bb17f8c506164efa39708cd2caea7aa11403f7.tar.gz |
[core] Use constexpr map for verticalized punctiation
-rw-r--r-- | src/mbgl/util/i18n.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mbgl/util/i18n.cpp b/src/mbgl/util/i18n.cpp index d3364f5e53..716481734e 100644 --- a/src/mbgl/util/i18n.cpp +++ b/src/mbgl/util/i18n.cpp @@ -3,6 +3,7 @@ #include <algorithm> #include <map> +#include <mapbox/eternal.hpp> namespace { @@ -320,7 +321,7 @@ DEFINE_IS_IN_UNICODE_BLOCK(HalfwidthandFullwidthForms, 0xFF00, 0xFFEF) // DEFINE_IS_IN_UNICODE_BLOCK(SupplementaryPrivateUseAreaA, 0xF0000, 0xFFFFF) // DEFINE_IS_IN_UNICODE_BLOCK(SupplementaryPrivateUseAreaB, 0x100000, 0x10FFFF) -const std::map<char16_t, char16_t> verticalPunctuation = { +MAPBOX_ETERNAL_CONSTEXPR const auto verticalPunctuation = mapbox::eternal::map<char16_t, char16_t>({ { u'!', u'︕' }, { u'#', u'#' }, { u'$', u'$' }, { u'%', u'%' }, { u'&', u'&' }, { u'(', u'︵' }, { u')', u'︶' }, { u'*', u'*' }, { u'+', u'+' }, { u',', u'︐' }, { u'-', u'︲' }, { u'.', u'・' }, { u'/', u'/' }, { u':', u'︓' }, { u';', u'︔' }, @@ -338,7 +339,8 @@ const std::map<char16_t, char16_t> verticalPunctuation = { { u'>', u'﹀' }, { u'?', u'︖' }, { u'[', u'﹇' }, { u']', u'﹈' }, { u'_', u'︳' }, { u'{', u'︷' }, { u'|', u'―' }, { u'}', u'︸' }, { u'⦅', u'︵' }, { u'⦆', u'︶' }, { u'。', u'︒' }, { u'「', u'﹁' }, { u'」', u'﹂' }, -}; +}); + } // namespace namespace mbgl { |