summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2018-10-19 15:51:58 +0200
committerKonstantin Käfer <mail@kkaefer.com>2018-10-23 12:23:40 +0200
commit9afe75aa76c02db21209e8f92b09be4b596a3983 (patch)
tree747d6fdd27550bf058dba6445794a7513761b6ad
parent7692be5d1571f2c02303aec1eb27432f634d0db2 (diff)
downloadqtlocation-mapboxgl-9afe75aa76c02db21209e8f92b09be4b596a3983.tar.gz
[core] address nits
-rw-r--r--src/mbgl/programs/program_parameters.cpp4
-rw-r--r--src/mbgl/shaders/shaders.cpp2
-rw-r--r--src/mbgl/util/hash.hpp4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/mbgl/programs/program_parameters.cpp b/src/mbgl/programs/program_parameters.cpp
index 2c70062e08..6b6c2bb2fe 100644
--- a/src/mbgl/programs/program_parameters.cpp
+++ b/src/mbgl/programs/program_parameters.cpp
@@ -11,7 +11,7 @@ ProgramParameters::ProgramParameters(const float pixelRatio,
result.reserve(32);
result += "#define DEVICE_PIXEL_RATIO ";
result += util::toString(pixelRatio, true);
- result += "\n";
+ result += '\n';
if (overdraw) {
result += "#define OVERDRAW_INSPECTOR\n";
}
@@ -33,7 +33,7 @@ optional<std::string> ProgramParameters::cachePath(const char* name) const {
result += *cacheDir;
result += "/com.mapbox.gl.shader.";
result += name;
- result += ".";
+ result += '.';
result += util::toHex(std::hash<std::string>()(defines));
result += ".pbf";
return result;
diff --git a/src/mbgl/shaders/shaders.cpp b/src/mbgl/shaders/shaders.cpp
index 04cfda35cc..c4f49a1a8c 100644
--- a/src/mbgl/shaders/shaders.cpp
+++ b/src/mbgl/shaders/shaders.cpp
@@ -18,7 +18,7 @@ std::string vertexSource(const ProgramParameters& parameters, const char* vertex
std::string programIdentifier(const std::string& vertexSource, const std::string& fragmentSource) {
std::string result;
- result.reserve(sizeof(size_t) * 2 * 2 + 2 + 1);
+ result.reserve((sizeof(size_t) * 2) * 2 + 2); // 2 size_t hex values + "v2"
result += util::toHex(std::hash<std::string>()(vertexSource));
result += util::toHex(std::hash<std::string>()(fragmentSource));
result += "v2";
diff --git a/src/mbgl/util/hash.hpp b/src/mbgl/util/hash.hpp
index 987a8bd8dc..89aba00f72 100644
--- a/src/mbgl/util/hash.hpp
+++ b/src/mbgl/util/hash.hpp
@@ -8,12 +8,12 @@ namespace mbgl {
namespace util {
template <class T>
-inline void hash_combine(std::size_t& seed, const T& v) {
+void hash_combine(std::size_t& seed, const T& v) {
seed ^= std::hash<T>()(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}
template <class... Args>
-inline std::size_t hash(Args&&... args) {
+std::size_t hash(Args&&... args) {
std::size_t seed = 0;
ignore({ (hash_combine(seed, args), 0)... });
return seed;