-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[LifetimeSafety] Use StringMap::contains (NFC) #167186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LifetimeSafety] Use StringMap::contains (NFC) #167186
Conversation
Identified with readability-container-contains.
|
@llvm/pr-subscribers-clang-temporal-safety Author: Kazu Hirata (kazutakahirata) ChangesIdentified with readability-container-contains. Full diff: https://github.com/llvm/llvm-project/pull/167186.diff 1 Files Affected:
diff --git a/clang/lib/Analysis/LifetimeSafety/Facts.cpp b/clang/lib/Analysis/LifetimeSafety/Facts.cpp
index 4a4172fe55bf3..190c038f46401 100644
--- a/clang/lib/Analysis/LifetimeSafety/Facts.cpp
+++ b/clang/lib/Analysis/LifetimeSafety/Facts.cpp
@@ -68,8 +68,7 @@ llvm::StringMap<ProgramPoint> FactManager::getTestPoints() const {
for (const Fact *F : BlockFacts) {
if (const auto *TPF = F->getAs<TestPointFact>()) {
StringRef PointName = TPF->getAnnotation();
- assert(AnnotationToPointMap.find(PointName) ==
- AnnotationToPointMap.end() &&
+ assert(!AnnotationToPointMap.contains(PointName) &&
"more than one test points with the same name");
AnnotationToPointMap[PointName] = F;
}
|
|
@llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) ChangesIdentified with readability-container-contains. Full diff: https://github.com/llvm/llvm-project/pull/167186.diff 1 Files Affected:
diff --git a/clang/lib/Analysis/LifetimeSafety/Facts.cpp b/clang/lib/Analysis/LifetimeSafety/Facts.cpp
index 4a4172fe55bf3..190c038f46401 100644
--- a/clang/lib/Analysis/LifetimeSafety/Facts.cpp
+++ b/clang/lib/Analysis/LifetimeSafety/Facts.cpp
@@ -68,8 +68,7 @@ llvm::StringMap<ProgramPoint> FactManager::getTestPoints() const {
for (const Fact *F : BlockFacts) {
if (const auto *TPF = F->getAs<TestPointFact>()) {
StringRef PointName = TPF->getAnnotation();
- assert(AnnotationToPointMap.find(PointName) ==
- AnnotationToPointMap.end() &&
+ assert(!AnnotationToPointMap.contains(PointName) &&
"more than one test points with the same name");
AnnotationToPointMap[PointName] = F;
}
|
|
@llvm/pr-subscribers-clang-analysis Author: Kazu Hirata (kazutakahirata) ChangesIdentified with readability-container-contains. Full diff: https://github.com/llvm/llvm-project/pull/167186.diff 1 Files Affected:
diff --git a/clang/lib/Analysis/LifetimeSafety/Facts.cpp b/clang/lib/Analysis/LifetimeSafety/Facts.cpp
index 4a4172fe55bf3..190c038f46401 100644
--- a/clang/lib/Analysis/LifetimeSafety/Facts.cpp
+++ b/clang/lib/Analysis/LifetimeSafety/Facts.cpp
@@ -68,8 +68,7 @@ llvm::StringMap<ProgramPoint> FactManager::getTestPoints() const {
for (const Fact *F : BlockFacts) {
if (const auto *TPF = F->getAs<TestPointFact>()) {
StringRef PointName = TPF->getAnnotation();
- assert(AnnotationToPointMap.find(PointName) ==
- AnnotationToPointMap.end() &&
+ assert(!AnnotationToPointMap.contains(PointName) &&
"more than one test points with the same name");
AnnotationToPointMap[PointName] = F;
}
|
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/157/builds/42054 Here is the relevant piece of the build log for the reference |
Identified with readability-container-contains.