2 ms·
>and also someone used a Set to check membership of single item. [1] Depending on where it was done (fast path or not), this could be just fine.
by coldtea 6y ago
>and also someone used a Set to check membership of single item. [1]
Depending on where it was done (fast path or not), this could be just fine.
- avasthe 6y agoYou don't know when something comes to hot path. if (std::set(itr.begin(), itr.end()).count(element)) { _____ } is it tempting for someone than something like std::find(itr.begin(), itr.end(), element) != itr.end()) ?? I don't know. That said, C++ STL quite undiscoverable.
- coldtea 6y ago>You don't know when something comes to hot path. That's the point of the first advice though...