Use strlen when possible since it's constexpr on gcc

This commit is contained in:
Victor Zverovich 2018-09-08 16:17:22 -07:00
parent 918bb1ce8f
commit 59c268a5f8

View File

@ -230,6 +230,9 @@ FMT_CONSTEXPR size_t length(const Char *s) {
while (*s) ++s;
return s - start;
}
#if FMT_GCC_VERSION
FMT_CONSTEXPR size_t length(const char *s) { return std::strlen(s); }
#endif
} // namespace internal
/**