mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-25 15:23:52 +00:00
[core] Switch to ankerl::unordered_dense
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
This commit is contained in:
@@ -118,10 +118,8 @@ size_t CountChar(Utf8 const & utf8)
|
||||
size_t codePoints = 0;
|
||||
|
||||
for (auto const c : utf8)
|
||||
{
|
||||
if ((c & 0xC0) != 0x80)
|
||||
++codePoints;
|
||||
}
|
||||
|
||||
return codePoints;
|
||||
}
|
||||
@@ -175,7 +173,7 @@ bool IsASCIILatin(UniChar c);
|
||||
|
||||
/// Escape characters not allowed in XML
|
||||
template <typename T>
|
||||
std::string EscapeForXML(const T & in)
|
||||
std::string EscapeForXML(T const & in)
|
||||
{
|
||||
std::string result;
|
||||
result.reserve(in.size());
|
||||
@@ -184,12 +182,12 @@ std::string EscapeForXML(const T & in)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case '&': result.append("&"); break;
|
||||
case '<': result.append("<"); break;
|
||||
case '>': result.append(">"); break;
|
||||
case '"': result.append("""); break;
|
||||
case '\'': result.append("'"); break;
|
||||
default: result.append(1, c); break;
|
||||
case '&': result.append("&"); break;
|
||||
case '<': result.append("<"); break;
|
||||
case '>': result.append(">"); break;
|
||||
case '"': result.append("""); break;
|
||||
case '\'': result.append("'"); break;
|
||||
default: result.append(1, c); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user