Runned clang-format over concurrent_map benchmark test and random::utils::generator

This commit is contained in:
sale
2016-11-23 13:47:52 +00:00
parent 0a56df3ddf
commit d8a82b45fc
2 changed files with 17 additions and 22 deletions

View File

@@ -24,11 +24,12 @@ class StringGenerator
: public RandomGenerator<std::uniform_int_distribution<int>,
std::default_random_engine> {
private:
int size_;
int size_;
public:
StringGenerator(int size)
: RandomGenerator(std::uniform_int_distribution<int>(32, 126)),
size_(size) {}
size_(size) {}
std::string next(int size) {
std::string random_string;
@@ -39,9 +40,7 @@ size_(size) {}
return random_string;
}
std::string next() {
return next(size_);
}
std::string next() { return next(size_); }
};
template <class Distribution, class Generator, class DistributionRangeType>
@@ -55,19 +54,18 @@ class NumberGenerator : public RandomGenerator<Distribution, Generator> {
template <class FirstGenerator, class SecondGenerator>
class PairGenerator {
private:
FirstGenerator* first_;
SecondGenerator* second_;
public:
PairGenerator(FirstGenerator* first, SecondGenerator* second) :
first_(first), second_(second) {}
auto next() {
return std::make_pair(first_->next(), second_->next());
}
private:
FirstGenerator *first_;
SecondGenerator *second_;
public:
PairGenerator(FirstGenerator *first, SecondGenerator *second)
: first_(first), second_(second) {}
auto next() { return std::make_pair(first_->next(), second_->next()); }
};
template <class RandomGenerator>
auto generate_vector(RandomGenerator& gen, int size) {
auto generate_vector(RandomGenerator &gen, int size) {
std::vector<decltype(gen.next())> elements(size);
for (int i = 0; i < size; i++) elements[i] = gen.next();
return elements;