avoid constructing TypeList's on-the-fly for ListVal's with fixed types

This commit is contained in:
Vern Paxson 2023-07-13 11:47:14 -07:00
parent 1d5bc841e0
commit 6b0d595dae
3 changed files with 16 additions and 3 deletions

View file

@ -661,8 +661,15 @@ private:
class ListVal final : public Val
{
public:
// Constructor used to build up a homogeneous list of values;
// or, if 't' is TYPE_ANY, then a heterogeneous one whose type
// is built up as values are appended.
explicit ListVal(TypeTag t);
// Constructor used to build the list in one shot, with the type
// pre-computed.
ListVal(TypeListPtr tl, std::vector<ValPtr> vals);
~ListVal() override = default;
TypeTag BaseTag() const { return tag; }