mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibJS: Create FunctionParameters earlier in the parser
This avoids making multiple copies of the Vector<FunctionParameter> in the parser.
This commit is contained in:
parent
d67a95c37e
commit
6c70dc5f09
Notes:
github-actions[bot]
2025-03-27 19:51:34 +00:00
Author: https://github.com/awesomekling
Commit: 6c70dc5f09
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4122
Reviewed-by: https://github.com/LucasChollet
3 changed files with 34 additions and 31 deletions
|
@ -696,6 +696,8 @@ class FunctionParameters : public RefCounted<FunctionParameters> {
|
|||
public:
|
||||
static NonnullRefPtr<FunctionParameters> create(Vector<FunctionParameter> parameters)
|
||||
{
|
||||
if (parameters.is_empty())
|
||||
return empty();
|
||||
return adopt_ref(*new FunctionParameters(move(parameters)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue