Skip to content

Commit 03ae7a2

Browse files
committed
AST: Remove unused EnumDecl::getElement() method
1 parent a6b5824 commit 03ae7a2

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

include/swift/AST/Decl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3541,8 +3541,6 @@ class EnumDecl final : public NominalTypeDecl {
35413541
return SourceRange(EnumLoc, getBraces().End);
35423542
}
35433543

3544-
EnumElementDecl *getElement(Identifier Name) const;
3545-
35463544
public:
35473545
/// A range for iterating the elements of an enum.
35483546
using ElementRange = DowncastFilterRange<EnumElementDecl, DeclRange>;

lib/AST/Decl.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4182,14 +4182,6 @@ EnumCaseDecl *EnumCaseDecl::create(SourceLoc CaseLoc,
41824182
return ::new (buf) EnumCaseDecl(CaseLoc, Elements, DC);
41834183
}
41844184

4185-
EnumElementDecl *EnumDecl::getElement(Identifier Name) const {
4186-
// FIXME: Linear search is not great for large enum decls.
4187-
for (EnumElementDecl *Elt : getAllElements())
4188-
if (Elt->getName() == Name)
4189-
return Elt;
4190-
return nullptr;
4191-
}
4192-
41934185
bool EnumDecl::hasPotentiallyUnavailableCaseValue() const {
41944186
switch (static_cast<AssociatedValueCheck>(Bits.EnumDecl.HasAssociatedValues)) {
41954187
case AssociatedValueCheck::Unchecked:

0 commit comments

Comments
 (0)