summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2014-10-17 12:02:51 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2014-10-17 12:03:43 -0700
commitd54809b04adf0b64e13b97852cfed860f92682a9 (patch)
treec244bf4c057596421cb21007724c19e7de00ca36
parent4e9688e430037b9a454320d8b29a5c99a9616fba (diff)
downloadqtlocation-mapboxgl-d54809b04adf0b64e13b97852cfed860f92682a9.tar.gz
Fix log message filtering
Taking the sizeof a pointer doesn't give you the array length!
-rw-r--r--include/mbgl/platform/log.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/mbgl/platform/log.hpp b/include/mbgl/platform/log.hpp
index dc000b4d52..406b3eea37 100644
--- a/include/mbgl/platform/log.hpp
+++ b/include/mbgl/platform/log.hpp
@@ -19,9 +19,9 @@ public:
class Log {
private:
- template <typename T>
- constexpr static bool includes(const T e, T const *l, const size_t i = 0) {
- return i >= sizeof l ? false : *(l + i) == e ? true : includes(e, l, i + 1);
+ template <typename T, size_t N>
+ constexpr static bool includes(const T e, const T (&l)[N], const size_t i = 0) {
+ return i < N && (l[i] == e || includes(e, l, i + 1));
}
public: