Skip to content

Commit 61e8a81

Browse files
committed
Remove extra tabs
1 parent 308e073 commit 61e8a81

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

templates/resolver.go

+19-21
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ const std::string DIGITS_SET = "0123456789";
3737
3838
// Used to determine the set of allowed characters
3939
// for the String method of the Rand class
40-
const int LOWER = 1;
41-
const int UPPER = 1 << 1;
40+
const int LOWER = 1;
41+
const int UPPER = 1 << 1;
4242
const int DIGITS = 1 << 2;
4343
4444
// Returns a random value of the following types
@@ -48,9 +48,9 @@ const int DIGITS = 1 << 2;
4848
// Rand rand(argc, argv);
4949
// int randomInt = rand.Int();
5050
// string randomString = rand.String(10, DIGITS);
51-
//
51+
//
5252
// @author NouemanKHAL
53-
//
53+
//
5454
class Rand {
5555
unsigned int seed;
5656
@@ -61,7 +61,7 @@ class Rand {
6161
return 0;
6262
}
6363
64-
public:
64+
public:
6565
Rand(unsigned int _seed = 0) : seed(_seed) { srand(seed); }
6666
6767
Rand(int argc, char* argv[]) {
@@ -70,28 +70,28 @@ public:
7070
}
7171
7272
// Returns an random int value in the range [from, to] inclusive
73-
int Int(int from, int to) {
74-
assert(from <= to);
75-
return rand() % (to - from) + from;
76-
}
73+
int Int(int from, int to) {
74+
assert(from <= to);
75+
return rand() % (to - from) + from;
76+
}
7777
7878
// Returns an random long long value in the range [from, to] inclusive
7979
long long Long(long long from, long long to) {
80-
assert(from <= to);
80+
assert(from <= to);
8181
return rand() % (to - from) + from;
8282
}
8383
8484
// Returns an random double value in the range [from, to] inclusive
8585
double Double(double from, double to) {
86-
assert(from <= to);
86+
assert(from <= to);
8787
double tmp = (double)rand() / RAND_MAX;
8888
return from + tmp * (to - from);
8989
}
9090
9191
// Returns an random char value in the range [from, to] inclusive
9292
// Parameters are optional
9393
char Char(char from = CHAR_MIN, char to = CHAR_MAX) {
94-
assert(from <= to);
94+
assert(from <= to);
9595
return static_cast<char>(Int(from, to));
9696
}
9797
@@ -119,21 +119,19 @@ public:
119119
// Returns an random digit character
120120
// Parameters are optional, by default returns a random digit character in the
121121
// range ['0', '9'] inclusive
122-
char Digit(char from = '0', char to = '9') {
123-
assert(from <= to);
124-
return Char(from, to);
125-
}
122+
char Digit(char from = '0', char to = '9') {
123+
assert(from <= to);
124+
return Char(from, to);
125+
}
126126
127127
// Returns a random alphanumerical character
128128
char AlphaNum() {
129129
if (rand() & 1) return Alpha();
130130
return Digit();
131131
}
132-
133-
// Returns a random boolean value.
134-
bool Bool() {
135-
return bool(rand() & 1);
136-
}
132+
133+
// Returns a random boolean value.
134+
bool Bool() { return bool(rand() & 1); }
137135
138136
// Returns an std::string of length size consisting only of characters allowed
139137
// in the given mask using the constants LOWER, UPPER, DIGITS Example: Rand

0 commit comments

Comments
 (0)