From 1a0a2f16ced484ca02d0d47b81ce0beec76d487a Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Tue, 15 Oct 2019 17:39:06 -0700 Subject: [PATCH] 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). --- doc | 2 +- src/Attr.cc | 6 ++---- src/Attr.h | 3 --- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/doc b/doc index 47138ec29f..e71c2a6563 160000 --- a/doc +++ b/doc @@ -1 +1 @@ -Subproject commit 47138ec29f404825122d749d4ebb5dd5b32338db +Subproject commit e71c2a656358aa88d053d424d7c726ad5b2ce88a diff --git a/src/Attr.cc b/src/Attr.cc index e512f0bfe4..74a6b2535b 100644 --- a/src/Attr.cc +++ b/src/Attr.cc @@ -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()); - + // We overwrite old attributes by deleting them first. + RemoveAttr(attr->Tag()); attrs->push_back(attr); Ref(attr); diff --git a/src/Attr.h b/src/Attr.h index fc33445618..53d60eda27 100644 --- a/src/Attr.h +++ b/src/Attr.h @@ -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;