Return reference to keys, don't copy keys

This commit is contained in:
Sebastian Messmer 2015-10-04 17:14:02 +02:00
parent e07ddaa289
commit 6e436b7a59
3 changed files with 3 additions and 3 deletions

View File

@ -76,7 +76,7 @@ void BlobOnBlocks::flush() {
_datatree->flush(); _datatree->flush();
} }
Key BlobOnBlocks::key() const { const Key &BlobOnBlocks::key() const {
return _datatree->key(); return _datatree->key();
} }

View File

@ -20,7 +20,7 @@ public:
BlobOnBlocks(cpputils::unique_ref<parallelaccessdatatreestore::DataTreeRef> datatree); BlobOnBlocks(cpputils::unique_ref<parallelaccessdatatreestore::DataTreeRef> datatree);
virtual ~BlobOnBlocks(); virtual ~BlobOnBlocks();
blockstore::Key key() const override; const blockstore::Key &key() const override;
uint64_t size() const override; uint64_t size() const override;
void resize(uint64_t numBytes) override; void resize(uint64_t numBytes) override;

View File

@ -13,7 +13,7 @@ public:
virtual ~Blob() {} virtual ~Blob() {}
//TODO Use own Key class for blobstore //TODO Use own Key class for blobstore
virtual blockstore::Key key() const = 0; virtual const blockstore::Key &key() const = 0;
virtual uint64_t size() const = 0; virtual uint64_t size() const = 0;
virtual void resize(uint64_t numBytes) = 0; virtual void resize(uint64_t numBytes) = 0;