3 ms·
I hate to be pedantic, but since you started it: That is not a contains() function. That is a search followed by a test for not not-found.
by qarl 3y ago
I hate to be pedantic, but since you started it:
That is not a contains() function. That is a search followed by a test for not not-found.
- Calavar 3y agoThat's a valid distinction for a vector or a list. For a set, contains and search are one and the same.
- qarl 3y agoNo, they are not the same thing. They are logically equivalent, which is not the same thing as same thing. 1+3 is logically equivalent to 4, but they are not the same. As just one example, the former contains an operation.