From d54809b04adf0b64e13b97852cfed860f92682a9 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 17 Oct 2014 12:02:51 -0700 Subject: [PATCH] Fix log message filtering Taking the sizeof a pointer doesn't give you the array length! --- include/mbgl/platform/log.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/mbgl/platform/log.hpp b/include/mbgl/platform/log.hpp index dc000b4d5..406b3eea3 100644 --- a/include/mbgl/platform/log.hpp +++ b/include/mbgl/platform/log.hpp @@ -19,9 +19,9 @@ public: class Log { private: - template - 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 + 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: