mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Stop allocating Token
s and ComponentValue
s 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:
parent
58631e9eef
commit
3f5e32ee84
Notes:
github-actions[bot]
2024-12-01 10:31:01 +00:00
Author: https://github.com/yyny
Commit: 3f5e32ee84
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2662
2 changed files with 132 additions and 7 deletions
|
@ -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>&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue