]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/bench/distribution.h: pass rngen_t by reference
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 10 Mar 2014 17:22:08 +0000 (18:22 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 10 Mar 2014 17:22:08 +0000 (18:22 +0100)
CID 1135927 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
 pass_by_value: Passing parameter rng of type rngen_t (size 1416 bytes)
 by value.

CID 1135928 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
 pass_by_value: Passing parameter rng of type rngen_t (size 1416 bytes)
 by value.

CID 1135929 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
 pass_by_value: Passing parameter rng of type rngen_t (size 1416 bytes)
 by value.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/test/bench/distribution.h

index 8e26571b27c72e854a18084764bf739fc4924177..d3525b8b66cc6af19eee752ccedabce2d6d6ae32 100644 (file)
@@ -45,7 +45,7 @@ class RandomDist : public Distribution<T> {
   rngen_t rng;
   std::map<uint64_t, T> contents;
 public:
-  RandomDist(rngen_t rng, std::set<T> &initial) : rng(rng) {
+  RandomDist(const rngen_t &rng, std::set<T> &initial) : rng(rng) {
     uint64_t count = 0;
     for (typename std::set<T>::iterator i = initial.begin();
         i != initial.end();
@@ -66,7 +66,7 @@ class WeightedDist : public Distribution<T> {
   double total;
   std::map<double, T> contents;
 public:
-  WeightedDist(rngen_t rng, const std::set<std::pair<double, T> > &initial)
+  WeightedDist(const rngen_t &rng, const std::set<std::pair<double, T> > &initial)
     : rng(rng), total(0) {
     for (typename std::set<std::pair<double, T> >::const_iterator i =
           initial.begin();
@@ -105,7 +105,7 @@ class UniformRandom : public Distribution<uint64_t> {
   uint64_t min;
   uint64_t max;
 public:
-  UniformRandom(rngen_t rng, uint64_t min, uint64_t max) :
+  UniformRandom(const rngen_t &rng, uint64_t min, uint64_t max) :
     rng(rng), min(min), max(max) {}
   virtual uint64_t operator()() {
     return boost::uniform_int<uint64_t>(min, max)(rng);