Browse code
Pass the clock by value to totp_generator
Ed Langley authored on 08/06/2017 00:14:16
Showing 2 changed files
Showing 2 changed files
... | ... |
@@ -61,7 +61,7 @@ unsigned long bytesToInt (const std::string &bytes) |
61 | 61 |
class token_generator_impl : public token_generator_ifc |
62 | 62 |
{ |
63 | 63 |
private: |
64 |
- const sys_time &clock; |
|
64 |
+ const sys_time clock; |
|
65 | 65 |
unsigned int code_digits; |
66 | 66 |
const std::string key; |
67 | 67 |
|
... | ... |
@@ -99,7 +99,7 @@ private: |
99 | 99 |
} |
100 | 100 |
|
101 | 101 |
public: |
102 |
- token_generator_impl (const sys_time &clock, |
|
102 |
+ token_generator_impl (const sys_time clock, |
|
103 | 103 |
const std::string &key, |
104 | 104 |
const int code_digits) : |
105 | 105 |
clock (clock), code_digits (code_digits), |
... | ... |
@@ -122,10 +122,9 @@ public: |
122 | 122 |
// Generator goes here.... |
123 | 123 |
|
124 | 124 |
totp_generator::totp_generator ( |
125 |
- const sys_time &clock, |
|
125 |
+ const sys_time clock, |
|
126 | 126 |
const std::string &key_c, |
127 | 127 |
const int code_digits) : |
128 | 128 |
delegate_ (std::make_shared<token_generator_impl> (clock, key_c, |
129 | 129 |
code_digits)) |
130 | 130 |
{} |
131 |
- |