aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-10-24 09:32:59 -0700
committerKazu Hirata <kazu@google.com>2021-10-24 09:32:59 -0700
commit1c35973c772b0c5e9c82d0c5d57d218a3eb6417d (patch)
treea5fc2420bec43245e1f8abecb493a60e0131f9bc /llvm/lib/IR/Attributes.cpp
parent7cc8fa2dd2d8167d427cadb4fc6f4254b53a8359 (diff)
downloadllvm-1c35973c772b0c5e9c82d0c5d57d218a3eb6417d.zip
llvm-1c35973c772b0c5e9c82d0c5d57d218a3eb6417d.tar.gz
llvm-1c35973c772b0c5e9c82d0c5d57d218a3eb6417d.tar.bz2
[llvm] Call *(Set|Map)::erase directly (NFC)
We can erase an item in a set or map without checking its membership first.
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index e431dc8..f81a446 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -1599,9 +1599,7 @@ AttrBuilder &AttrBuilder::removeAttributes(AttributeList A, uint64_t Index) {
}
AttrBuilder &AttrBuilder::removeAttribute(StringRef A) {
- auto I = TargetDepAttrs.find(A);
- if (I != TargetDepAttrs.end())
- TargetDepAttrs.erase(I);
+ TargetDepAttrs.erase(A);
return *this;
}