summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2017-12-14 06:45:12 -0800
committerMinh Nguyễn <mxn@1ec5.org>2017-12-14 09:14:54 -0800
commit40f20a1339002be46888d3d43f756c0a6690ce12 (patch)
tree30464deeb02cba303972688cacadf6e5906dfdef
parentd2cc855cd3e45aff7d079ecd21c814cae4fc2465 (diff)
downloadqtlocation-mapboxgl-40f20a1339002be46888d3d43f756c0a6690ce12.tar.gz
[core] Migrated upcase, downcase to platform code
Replaced manual, per-character upper- and lowercasing code with calls to platform-specific code that affects a wider range of characters.
-rw-r--r--src/mbgl/style/expression/compound_expression.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/mbgl/style/expression/compound_expression.cpp b/src/mbgl/style/expression/compound_expression.cpp
index fa79357560..70bc6dfd95 100644
--- a/src/mbgl/style/expression/compound_expression.cpp
+++ b/src/mbgl/style/expression/compound_expression.cpp
@@ -5,6 +5,7 @@
#include <mbgl/math/log2.hpp>
#include <mbgl/util/ignore.hpp>
#include <mbgl/util/string.hpp>
+#include <mbgl/util/platform.hpp>
namespace mbgl {
namespace style {
@@ -397,16 +398,10 @@ std::unordered_map<std::string, CompoundExpressionRegistry::Definition> initiali
define("!", [](bool e) -> Result<bool> { return !e; });
define("upcase", [](const std::string& input) -> Result<std::string> {
- std::string s = input;
- std::transform(s.begin(), s.end(), s.begin(),
- [](unsigned char c){ return std::toupper(c); });
- return s;
+ return platform::uppercase(input);
});
define("downcase", [](const std::string& input) -> Result<std::string> {
- std::string s = input;
- std::transform(s.begin(), s.end(), s.begin(),
- [](unsigned char c){ return std::tolower(c); });
- return s;
+ return platform::lowercase(input);
});
define("concat", [](const Varargs<std::string>& args) -> Result<std::string> {
std::string s;