File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -261,7 +261,7 @@ class SetVector {
261261 }
262262
263263 // / Check if the SetVector contains the given key.
264- bool contains (const key_type &key) const {
264+ [[nodiscard]] bool contains (const key_type &key) const {
265265 if constexpr (canBeSmall ())
266266 if (isSmall ())
267267 return is_contained (vector_, key);
@@ -271,12 +271,8 @@ class SetVector {
271271
272272 // / Count the number of elements of a given key in the SetVector.
273273 // / \returns 0 if the element is not in the SetVector, 1 if it is.
274- size_type count (const key_type &key) const {
275- if constexpr (canBeSmall ())
276- if (isSmall ())
277- return is_contained (vector_, key);
278-
279- return set_.count (key);
274+ [[nodiscard]] size_type count (const key_type &key) const {
275+ return contains (key) ? 1 : 0 ;
280276 }
281277
282278 // / Completely clear the SetVector
You can’t perform that action at this time.
0 commit comments