From b5ab318a2d33e99e322ee02f2dd037929232db58 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 7 Apr 2015 23:21:14 +0100 Subject: [PATCH] Always optimize StringView::strlen (recursive due to constexpr) --- src/string.hh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/string.hh b/src/string.hh index 6b66bce4..a6a267cb 100644 --- a/src/string.hh +++ b/src/string.hh @@ -164,6 +164,7 @@ public: ZeroTerminatedString zstr() const { return {begin(), end()}; } private: + [[gnu::optimize(3)]] // this is recursive for constexpr reason static constexpr ByteCount strlen(const char* s) { return *s == 0 ? 0 : strlen(s+1) + 1;