mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibWeb: Stop allocating Tokens and ComponentValues unnecessarily
When the "Consume a component value from input, and do nothing."
step in `Parser::consume_the_remnants_of_a_bad_declaration` was
executed, it would allocate a `ComponentValue` that was then
immediately discarded.
Add explicitly `{}_and_do_nothing` functions for this case that never
allocate a `ComponentValue` in the first place.
Also remove a `(Token)` cast, which was unnecessarily copying a `Token`
as well.
This commit is contained in:
committed by
Andreas Kling
parent
58631e9eef
commit
3f5e32ee84
@@ -161,9 +161,15 @@ private:
|
||||
template<typename T>
|
||||
[[nodiscard]] ComponentValue consume_a_component_value(TokenStream<T>&);
|
||||
template<typename T>
|
||||
void consume_a_component_value_and_do_nothing(TokenStream<T>&);
|
||||
template<typename T>
|
||||
SimpleBlock consume_a_simple_block(TokenStream<T>&);
|
||||
template<typename T>
|
||||
void consume_a_simple_block_and_do_nothing(TokenStream<T>&);
|
||||
template<typename T>
|
||||
Function consume_a_function(TokenStream<T>&);
|
||||
template<typename T>
|
||||
void consume_a_function_and_do_nothing(TokenStream<T>&);
|
||||
// TODO: consume_a_unicode_range_value()
|
||||
|
||||
Optional<GeneralEnclosed> parse_general_enclosed(TokenStream<ComponentValue>&);
|
||||
|
||||
Reference in New Issue
Block a user