1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:44:58 +00:00

Unicode: Try s/codepoint/code_point/g again

This time, without trailing 's'. Ran:

    git grep -l 'codepoint' | xargs sed -ie 's/codepoint/code_point/g
This commit is contained in:
Nico Weber 2020-08-05 16:31:20 -04:00 committed by Andreas Kling
parent 19ac1f6368
commit ce95628b7f
45 changed files with 441 additions and 441 deletions

View file

@ -113,22 +113,22 @@ void StringBuilder::clear()
m_length = 0;
}
void StringBuilder::append_codepoint(u32 codepoint)
void StringBuilder::append_code_point(u32 code_point)
{
if (codepoint <= 0x7f) {
append((char)codepoint);
} else if (codepoint <= 0x07ff) {
append((char)(((codepoint >> 6) & 0x1f) | 0xc0));
append((char)(((codepoint >> 0) & 0x3f) | 0x80));
} else if (codepoint <= 0xffff) {
append((char)(((codepoint >> 12) & 0x0f) | 0xe0));
append((char)(((codepoint >> 6) & 0x3f) | 0x80));
append((char)(((codepoint >> 0) & 0x3f) | 0x80));
} else if (codepoint <= 0x10ffff) {
append((char)(((codepoint >> 18) & 0x07) | 0xf0));
append((char)(((codepoint >> 12) & 0x3f) | 0x80));
append((char)(((codepoint >> 6) & 0x3f) | 0x80));
append((char)(((codepoint >> 0) & 0x3f) | 0x80));
if (code_point <= 0x7f) {
append((char)code_point);
} else if (code_point <= 0x07ff) {
append((char)(((code_point >> 6) & 0x1f) | 0xc0));
append((char)(((code_point >> 0) & 0x3f) | 0x80));
} else if (code_point <= 0xffff) {
append((char)(((code_point >> 12) & 0x0f) | 0xe0));
append((char)(((code_point >> 6) & 0x3f) | 0x80));
append((char)(((code_point >> 0) & 0x3f) | 0x80));
} else if (code_point <= 0x10ffff) {
append((char)(((code_point >> 18) & 0x07) | 0xf0));
append((char)(((code_point >> 12) & 0x3f) | 0x80));
append((char)(((code_point >> 6) & 0x3f) | 0x80));
append((char)(((code_point >> 0) & 0x3f) | 0x80));
} else {
append(0xef);
append(0xbf);
@ -139,8 +139,8 @@ void StringBuilder::append_codepoint(u32 codepoint)
void StringBuilder::append(const Utf32View& utf32_view)
{
for (size_t i = 0; i < utf32_view.length(); ++i) {
auto codepoint = utf32_view.codepoints()[i];
append_codepoint(codepoint);
auto code_point = utf32_view.code_points()[i];
append_code_point(code_point);
}
}