mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 03:28:19 +00:00
avoid constructing TypeList's on-the-fly for ListVal's with fixed types
This commit is contained in:
parent
1d5bc841e0
commit
6b0d595dae
3 changed files with 16 additions and 3 deletions
|
@ -5029,7 +5029,7 @@ bool ListExpr::IsPure() const
|
|||
|
||||
ValPtr ListExpr::Eval(Frame* f) const
|
||||
{
|
||||
auto v = make_intrusive<ListVal>(TYPE_ANY);
|
||||
std::vector<ValPtr> evs;
|
||||
|
||||
for ( const auto& expr : exprs )
|
||||
{
|
||||
|
@ -5041,10 +5041,10 @@ ValPtr ListExpr::Eval(Frame* f) const
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
v->Append(std::move(ev));
|
||||
evs.push_back(std::move(ev));
|
||||
}
|
||||
|
||||
return v;
|
||||
return make_intrusive<ListVal>(cast_intrusive<TypeList>(type), std::move(evs));
|
||||
}
|
||||
|
||||
TypePtr ListExpr::InitType() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue