1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:57:45 +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

@ -7,6 +7,7 @@
#pragma once
#include <AK/FlyString.h>
#include <AK/String.h>
#include <AK/StringBuilder.h>
#include <math.h>
@ -132,7 +133,7 @@ public:
StringView dimension_unit() const
{
VERIFY(m_type == Type::Dimension);
return m_unit.string_view();
return m_unit.view();
}
double dimension_value() const
{
@ -175,7 +176,7 @@ private:
Type m_type { Type::Invalid };
StringBuilder m_value;
StringBuilder m_unit;
FlyString m_unit;
HashType m_hash_type { HashType::Unrestricted };
NumberType m_number_type { NumberType::Integer };
double m_number_value { 0 };