[llvm] d72aa10 - [ADT] Remove an extraneous ternary operator (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 24 20:44:23 PDT 2023
Author: Kazu Hirata
Date: 2023-10-24T20:44:16-07:00
New Revision: d72aa10a9a08e8213c84060de5a78bfb2fc1a6e5
URL: https://github.com/llvm/llvm-project/commit/d72aa10a9a08e8213c84060de5a78bfb2fc1a6e5
DIFF: https://github.com/llvm/llvm-project/commit/d72aa10a9a08e8213c84060de5a78bfb2fc1a6e5.diff
LOG: [ADT] Remove an extraneous ternary operator (NFC)
Added:
Modified:
llvm/include/llvm/ADT/SparseSet.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/SparseSet.h b/llvm/include/llvm/ADT/SparseSet.h
index 4a999e6b4c69a6d..c7793117ff54083 100644
--- a/llvm/include/llvm/ADT/SparseSet.h
+++ b/llvm/include/llvm/ADT/SparseSet.h
@@ -233,7 +233,7 @@ class SparseSet {
/// Check if the set contains the given \c Key.
///
/// @param Key A valid key to find.
- bool contains(const KeyT &Key) const { return find(Key) == end() ? 0 : 1; }
+ bool contains(const KeyT &Key) const { return find(Key) != end(); }
/// count - Returns 1 if this set contains an element identified by Key,
/// 0 otherwise.
More information about the llvm-commits
mailing list