mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
ListVal method to clear the list to allow reusing w/o new construction
This commit is contained in:
parent
5d37e6bb5c
commit
3962810e4b
2 changed files with 12 additions and 0 deletions
|
@ -341,6 +341,9 @@ public:
|
||||||
void Append(TypePtr t);
|
void Append(TypePtr t);
|
||||||
void AppendEvenIfNotPure(TypePtr t);
|
void AppendEvenIfNotPure(TypePtr t);
|
||||||
|
|
||||||
|
// Resets the list to be empty.
|
||||||
|
void Clear() { types.clear(); }
|
||||||
|
|
||||||
detail::TraversalCode Traverse(detail::TraversalCallback* cb) const override;
|
detail::TraversalCode Traverse(detail::TraversalCallback* cb) const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -684,6 +684,15 @@ public:
|
||||||
*/
|
*/
|
||||||
void Append(ValPtr v);
|
void Append(ValPtr v);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Empties the list.
|
||||||
|
* @param v the value to append.
|
||||||
|
*/
|
||||||
|
void Clear() {
|
||||||
|
vals.clear();
|
||||||
|
type->AsTypeList()->Clear();
|
||||||
|
}
|
||||||
|
|
||||||
// Returns a Set representation of the list (which must be homogeneous).
|
// Returns a Set representation of the list (which must be homogeneous).
|
||||||
TableValPtr ToSetVal() const;
|
TableValPtr ToSetVal() const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue