From: Danny Al-Gaaf Date: Mon, 10 Mar 2014 17:22:08 +0000 (+0100) Subject: test/bench/distribution.h: pass rngen_t by reference X-Git-Tag: v0.79~150^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=200f7478df4b191f0bffcee814988f832105749c;p=ceph.git test/bench/distribution.h: pass rngen_t by reference 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 --- diff --git a/src/test/bench/distribution.h b/src/test/bench/distribution.h index 8e26571b27c..d3525b8b66c 100644 --- a/src/test/bench/distribution.h +++ b/src/test/bench/distribution.h @@ -45,7 +45,7 @@ class RandomDist : public Distribution { rngen_t rng; std::map contents; public: - RandomDist(rngen_t rng, std::set &initial) : rng(rng) { + RandomDist(const rngen_t &rng, std::set &initial) : rng(rng) { uint64_t count = 0; for (typename std::set::iterator i = initial.begin(); i != initial.end(); @@ -66,7 +66,7 @@ class WeightedDist : public Distribution { double total; std::map contents; public: - WeightedDist(rngen_t rng, const std::set > &initial) + WeightedDist(const rngen_t &rng, const std::set > &initial) : rng(rng), total(0) { for (typename std::set >::const_iterator i = initial.begin(); @@ -105,7 +105,7 @@ class UniformRandom : public Distribution { 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(min, max)(rng);