diff options
author | Roland Reichwein <mail@reichwein.it> | 2021-12-18 10:16:40 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2021-12-18 10:16:40 +0100 |
commit | 00ac8aad7ff3d0a82419b31cdeaa593d228c07d1 (patch) | |
tree | 57266afe38b54f7b9db3be9e0e6dfa0db13a0108 /include | |
parent | 7aff3a1a8439e1465e4e5ca99fa4d1e18fe3df38 (diff) |
Speed optimization
Diffstat (limited to 'include')
-rw-r--r-- | include/unicode.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/unicode.h b/include/unicode.h index 37342a1..277c4de 100644 --- a/include/unicode.h +++ b/include/unicode.h @@ -30,7 +30,7 @@ namespace unicode { template<typename T> static inline bool is_valid_unicode(const T& value) { - return value <= 0x10FFFF && (value <= 0xD7FF || value >= 0xE000); + return value <= 0xD7FF || (value >= 0xE000 && value <= 0x10FFFF); } } @@ -475,7 +475,7 @@ namespace unicode { if (value > 255) throw std::invalid_argument("Bad Unicode value above 255: "s + std::to_string(static_cast<uint32_t>(value))); - s.push_back(static_cast<utf8_t>(value)); + s.push_back(static_cast<typename iso_back_insert_iterator::value_type>(value)); return *this; } |