mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-19 11:14:41 +00:00
Apply minor optimizations
This commit is contained in:
parent
25adca5666
commit
58d792b6d3
@ -467,6 +467,7 @@ template <typename Char> FMT_CONSTEXPR auto length(const Char* s) -> size_t {
|
||||
template <typename Char>
|
||||
FMT_CONSTEXPR auto compare(const Char* s1, const Char* s2, std::size_t n)
|
||||
-> int {
|
||||
if (!is_constant_evaluated() && sizeof(Char) == 1) return memcmp(s1, s2, n);
|
||||
for (; n != 0; ++s1, ++s2, --n) {
|
||||
if (*s1 < *s2) return -1;
|
||||
if (*s1 > *s2) return 1;
|
||||
|
@ -553,7 +553,7 @@ struct scan_handler {
|
||||
return begin;
|
||||
}
|
||||
|
||||
void on_error(const char* message) { report_error(message); }
|
||||
FMT_NORETURN void on_error(const char* message) { report_error(message); }
|
||||
};
|
||||
|
||||
void vscan(detail::scan_buffer& buf, string_view fmt, scan_args args) {
|
||||
|
Loading…
Reference in New Issue
Block a user