diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-07-17 18:41:44 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-07-17 18:42:26 +0000 |
commit | 9c28bea523226db4fef99ba6896b7dc1ea63959b (patch) | |
tree | bb450b83282967c44f47389fe330ad54a7ba5bfd | |
parent | a0a8cc121663a7d3dbebd426ae2e5953df45c66f (diff) |
Use standard return value.
3 files changed, 6 insertions, 6 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.cpp b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.cpp index 237fd59f78d..ecdc679e4bc 100644 --- a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.cpp @@ -164,13 +164,15 @@ BucketDB::isActiveBucket(const BucketId &bucketId) const return (itr != _map.end()) && itr->second.isActive(); } -void -BucketDB::getBuckets(BucketId::List &buckets) const +document::BucketId::List +BucketDB::getBuckets() const { + BucketId::List buckets; buckets.reserve(_map.size()); for (const auto & entry : _map) { buckets.push_back(entry.first); } + return buckets; } bool diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.h b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.h index 99f31712234..da475f2969a 100644 --- a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.h +++ b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.h @@ -56,7 +56,7 @@ public: storage::spi::BucketInfo cachedGetBucketInfo(const BucketId &bucketId) const; BucketState cachedGet(const BucketId &bucketId) const; bool hasBucket(const BucketId &bucketId) const; - void getBuckets(BucketId::List & buckets) const; + BucketId::List getBuckets() const; bool empty() const; void setBucketState(const BucketId &bucketId, bool active); void createBucket(const BucketId &bucketId); @@ -67,7 +67,6 @@ public: ConstMapIterator begin() const { return _map.begin(); } ConstMapIterator end() const { return _map.end(); } ConstMapIterator lowerBound(const BucketId &bucket) const { return _map.lower_bound(bucket); } - ConstMapIterator upperBound(const BucketId &bucket) const { return _map.upper_bound(bucket); } size_t size() const { return _map.size(); } bool isActiveBucket(const BucketId &bucketId) const; BucketState *getBucketStatePtr(const BucketId &bucket); diff --git a/searchcore/src/vespa/searchcore/proton/server/buckethandler.cpp b/searchcore/src/vespa/searchcore/proton/server/buckethandler.cpp index d9201ce5b9e..080d182d1fa 100644 --- a/searchcore/src/vespa/searchcore/proton/server/buckethandler.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/buckethandler.cpp @@ -90,8 +90,7 @@ BucketHandler::handleListBuckets(IBucketIdListResultHandler &resultHandler) // Called by SPI thread. // BucketDBOwner ensures synchronization between SPI thread and // master write thread in document database. - BucketIdListResult::List buckets; - _ready->getBucketDB().takeGuard()->getBuckets(buckets); + BucketIdListResult::List buckets = _ready->getBucketDB().takeGuard()->getBuckets(); resultHandler.handle(BucketIdListResult(std::move(buckets))); } |