contains member function on unordered set is not available when using
gcc 8.
@@ -26,7 +26,8 @@ std::unique_ptr<BucketTask>
DummyBucketExecutor::execute(const Bucket & bucket, std::unique_ptr<BucketTask> task) {
{
std::unique_lock guard(_lock);
- while (_inFlight.contains(bucket.getBucket())) {
+ // Use contains when dropping support for gcc 8.
+ while (_inFlight.count(bucket.getBucket()) != 0) {
_cond.wait(guard);
}
_inFlight.insert(bucket.getBucket());
@@ -34,7 +35,8 @@ DummyBucketExecutor::execute(const Bucket & bucket, std::unique_ptr<BucketTask>
_executor->execute(makeLambdaTask([this, bucket, bucketTask=std::move(task)]() {
bucketTask->run(bucket, makeLambdaCallback([this, bucket]() {
std::unique_lock guard(_lock);
- assert(_inFlight.contains(bucket.getBucket()));
+ // Use contains when dropping support for gcc 8.
+ assert(_inFlight.count(bucket.getBucket()) != 0);
_inFlight.erase(bucket.getBucket());
_cond.notify_all();
}));
