1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:27:34 +00:00

Everywhere: Add sv suffix to strings relying on StringView(char const*)

Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
This commit is contained in:
sin-ack 2022-07-11 17:32:29 +00:00 committed by Andreas Kling
parent e5f09ea170
commit 3f3f45580a
762 changed files with 8315 additions and 8316 deletions

View file

@ -84,29 +84,29 @@ String Table::render_to_html(bool) const
StringBuilder builder;
builder.append("<table>");
builder.append("<thead>");
builder.append("<tr>");
builder.append("<table>"sv);
builder.append("<thead>"sv);
builder.append("<tr>"sv);
for (auto& column : m_columns) {
builder.appendff("<th style='text-align: {}'>", alignment_string(column.alignment));
builder.append(column.header.render_to_html());
builder.append("</th>");
builder.append("</th>"sv);
}
builder.append("</tr>");
builder.append("</thead>");
builder.append("<tbody>");
builder.append("</tr>"sv);
builder.append("</thead>"sv);
builder.append("<tbody>"sv);
for (size_t i = 0; i < m_row_count; ++i) {
builder.append("<tr>");
builder.append("<tr>"sv);
for (auto& column : m_columns) {
VERIFY(i < column.rows.size());
builder.appendff("<td style='text-align: {}'>", alignment_string(column.alignment));
builder.append(column.rows[i].render_to_html());
builder.append("</td>");
builder.append("</td>"sv);
}
builder.append("</tr>");
builder.append("</tr>"sv);
}
builder.append("</tbody>");
builder.append("</table>");
builder.append("</tbody>"sv);
builder.append("</table>"sv);
return builder.to_string();
}
@ -224,7 +224,7 @@ OwnPtr<Table> Table::parse(LineIterator& lines)
if (i >= segments.size()) {
// Ran out of segments, but still have headers.
// Just make an empty cell.
table->m_columns[i].rows.append(Text::parse(""));
table->m_columns[i].rows.append(Text::parse(""sv));
} else {
auto text = Text::parse(segments[i]);
table->m_columns[i].rows.append(move(text));