Reduce the size of Func::Body quite a bit with some extra packing

This commit is contained in:
Tim Wojtulewicz 2025-07-28 08:49:38 -07:00
parent 72c79006ac
commit 2cfa5e79fa
2 changed files with 3 additions and 2 deletions

View file

@ -564,7 +564,7 @@ void ScriptFunc::AddBody(StmtPtr new_body, const std::vector<IDPtr>& new_inits,
Body b;
b.stmts = new_body;
b.groups = groups;
b.groups = {groups.begin(), groups.end()};
current_body = new_body;
current_priority = b.priority = priority;

View file

@ -2,6 +2,7 @@
#pragma once
#include <forward_list>
#include <memory>
#include <string>
#include <tuple>
@ -66,8 +67,8 @@ public:
struct Body {
detail::StmtPtr stmts;
std::forward_list<EventGroupPtr> groups;
int priority;
std::set<EventGroupPtr> groups;
// If any of the groups are disabled, this body is disabled.
// The disabled field is updated from EventGroup instances.
bool disabled = false;