mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Remove check for redundant attributes
Letting there be redundant attributes serves no purpose. It could also potentially cause long attribute lists containing many useless &redef or &optional attributes (e.g. think that may happen if you use redef enough times and the new attributes keep getting merged into the old ones).
This commit is contained in:
parent
5265613a9e
commit
1a0a2f16ce
3 changed files with 3 additions and 8 deletions
2
doc
2
doc
|
@ -1 +1 @@
|
|||
Subproject commit 47138ec29f404825122d749d4ebb5dd5b32338db
|
||||
Subproject commit e71c2a656358aa88d053d424d7c726ad5b2ce88a
|
|
@ -164,10 +164,8 @@ void Attributes::AddAttr(Attr* attr)
|
|||
if ( ! attrs )
|
||||
attrs = new attr_list(1);
|
||||
|
||||
if ( ! attr->RedundantAttrOkay() )
|
||||
// We overwrite old attributes by deleting them first.
|
||||
RemoveAttr(attr->Tag());
|
||||
|
||||
attrs->push_back(attr);
|
||||
Ref(attr);
|
||||
|
||||
|
|
|
@ -46,9 +46,6 @@ public:
|
|||
// previous expr as the new expr depends on it.
|
||||
void SetAttrExpr(Expr* e) { expr = e; }
|
||||
|
||||
int RedundantAttrOkay() const
|
||||
{ return tag == ATTR_REDEF || tag == ATTR_OPTIONAL; }
|
||||
|
||||
void Describe(ODesc* d) const override;
|
||||
void DescribeReST(ODesc* d, bool shorten = false) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue