We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a533f0 commit f47d82cCopy full SHA for f47d82c
unicode.h
@@ -1,4 +1,4 @@
1
-#pragma once
+#pragma once
2
3
#include <cassert>
4
#include <stdexcept>
@@ -404,7 +404,8 @@ static std::unordered_map<uint32_t, int> codepoint_type_map() {
404
405
static int codepoint_type(uint32_t cp) {
406
static std::unordered_map<uint32_t, int> codepoint_types = codepoint_type_map();
407
- return codepoint_types.find(cp) == codepoint_types.end() ? CODEPOINT_TYPE_UNIDENTIFIED : codepoint_types.at(cp);
+ const auto it = codepoint_types.find(cp);
408
+ return it == codepoint_types.end() ? CODEPOINT_TYPE_UNIDENTIFIED : it->second;
409
}
410
411
static int codepoint_type(const std::string & utf8) {
0 commit comments