summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@oath.com>2018-04-13 14:23:42 +0000
committerTor Brede Vekterli <vekterli@oath.com>2018-04-13 14:48:47 +0000
commit19ec60721c18b2835d843b73e170c2ea94ebcc45 (patch)
tree8b2fcdb27ea4c5771885c169643475a745284d9e
parentc5d7f0eb6af0adb698a62b83b5ca1c121618b857 (diff)
Remove strange temporary value pointer code
Overriding unary & is potentially dangerous and the code does not give any justification for why it is done. Nor should it be necessary, since passing an rvalue as a const ref into the LoadMetric to be used as a template should suffice plenty.
-rw-r--r--storage/src/vespa/storage/persistence/filestorage/filestormetrics.cpp18
-rw-r--r--storage/src/vespa/storage/persistence/filestorage/filestormetrics.h5
2 files changed, 9 insertions, 14 deletions
diff --git a/storage/src/vespa/storage/persistence/filestorage/filestormetrics.cpp b/storage/src/vespa/storage/persistence/filestorage/filestormetrics.cpp
index 8f56040035c..1293b5d1808 100644
--- a/storage/src/vespa/storage/persistence/filestorage/filestormetrics.cpp
+++ b/storage/src/vespa/storage/persistence/filestorage/filestormetrics.cpp
@@ -121,16 +121,16 @@ FileStorThreadMetrics::FileStorThreadMetrics(const std::string& name, const std:
: MetricSet(name, "filestor partofsum thread", desc, nullptr, "thread"),
operations("operations", "", "Number of operations processed.", this),
failedOperations("failedoperations", "", "Number of operations throwing exceptions.", this),
- put(lt, *&OpWithRequestSize<Op>("put", "Put"), this),
- get(lt, *&OpWithRequestSize<OpWithNotFound>("get", "Get"), this),
- remove(lt, *&OpWithRequestSize<OpWithNotFound>("remove", "Remove"), this),
- removeLocation(lt, *&Op("remove_location", "Remove location"), this),
- statBucket(lt, *&Op("stat_bucket", "Stat bucket"), this),
- update(lt, *&Update(), this),
- revert(lt, *&OpWithNotFound("revert", "Revert"), this),
+ put(lt, OpWithRequestSize<Op>("put", "Put"), this),
+ get(lt, OpWithRequestSize<OpWithNotFound>("get", "Get"), this),
+ remove(lt, OpWithRequestSize<OpWithNotFound>("remove", "Remove"), this),
+ removeLocation(lt, Op("remove_location", "Remove location"), this),
+ statBucket(lt, Op("stat_bucket", "Stat bucket"), this),
+ update(lt, Update(), this),
+ revert(lt, OpWithNotFound("revert", "Revert"), this),
createIterator("createiterator", "", this),
- visit(lt, *&Visitor(), this),
- multiOp(lt, *&Op("multioperations", "The number of multioperations that have been created"), this),
+ visit(lt, Visitor(), this),
+ multiOp(lt, Op("multioperations", "The number of multioperations that have been created"), this),
createBuckets("createbuckets", "Number of buckets that has been created.", this),
deleteBuckets("deletebuckets", "Number of buckets that has been deleted.", this),
repairs("bucketverified", "Number of times buckets have been checked.", this),
diff --git a/storage/src/vespa/storage/persistence/filestorage/filestormetrics.h b/storage/src/vespa/storage/persistence/filestorage/filestormetrics.h
index afffb3da126..3bc7fa33660 100644
--- a/storage/src/vespa/storage/persistence/filestorage/filestormetrics.h
+++ b/storage/src/vespa/storage/persistence/filestorage/filestormetrics.h
@@ -30,7 +30,6 @@ struct FileStorThreadMetrics : public metrics::MetricSet
MetricSet * clone(std::vector<Metric::UP>& ownerList, CopyType copyType,
MetricSet* owner, bool includeUnused) const override;
- Op* operator&() { return this; }
};
template <typename BaseOp>
@@ -42,7 +41,6 @@ struct FileStorThreadMetrics : public metrics::MetricSet
MetricSet * clone(std::vector<Metric::UP>& ownerList, CopyType copyType,
MetricSet* owner, bool includeUnused) const override;
- OpWithRequestSize* operator&() { return this; }
};
struct OpWithNotFound : Op {
@@ -52,7 +50,6 @@ struct FileStorThreadMetrics : public metrics::MetricSet
~OpWithNotFound() override;
MetricSet* clone(std::vector<Metric::UP>& ownerList, CopyType copyType,
MetricSet* owner, bool includeUnused) const override;
- OpWithNotFound* operator&() { return this; }
};
struct Update : OpWithRequestSize<OpWithNotFound> {
@@ -63,7 +60,6 @@ struct FileStorThreadMetrics : public metrics::MetricSet
MetricSet* clone(std::vector<Metric::UP>& ownerList, CopyType copyType,
MetricSet* owner, bool includeUnused) const override;
- Update* operator&() { return this; }
};
struct Visitor : Op {
@@ -74,7 +70,6 @@ struct FileStorThreadMetrics : public metrics::MetricSet
MetricSet * clone(std::vector<Metric::UP>& ownerList, CopyType copyType,
MetricSet* owner, bool includeUnused) const override;
- Visitor* operator&() { return this; }
};
metrics::LongCountMetric operations;