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

LibWeb: Convert CSS Token::m_unit from StringBuilder to FlyString

This value doesn't change once it's assigned to the Token, so it can be
more lightweight than a StringBuilder.
This commit is contained in:
Sam Atkins 2021-10-28 12:01:15 +01:00 committed by Andreas Kling
parent 9286aa77bc
commit 75e7c2c5c0
3 changed files with 7 additions and 6 deletions

View file

@ -59,12 +59,12 @@ String Token::to_debug_string() const
case Type::Percentage:
builder.append("Percentage: ");
builder.append(m_value.to_string());
builder.append(m_unit.to_string());
builder.append('%');
return builder.to_string();
case Type::Dimension:
builder.append("Dimension: ");
builder.append(m_value.to_string());
builder.append(m_unit.to_string());
builder.append(m_unit);
return builder.to_string();
case Type::Whitespace:
builder.append("Whitespace");
@ -140,7 +140,7 @@ String Token::to_debug_string() const
}
builder.append("', unit: '");
builder.append(m_unit.to_string());
builder.append(m_unit);
}
builder.append("' }");