chore(generator): collapse 2 try-catch blocks
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
348b921795
commit
ffd0180578
|
@ -174,13 +174,9 @@ auto Generator::generate_random_data(const uint64_t& n) -> std::string {
|
||||||
|
|
||||||
r = rr.substr(0, n); // not hex-encoded anymore, just ask for n chars
|
r = rr.substr(0, n); // not hex-encoded anymore, just ask for n chars
|
||||||
rr.clear();
|
rr.clear();
|
||||||
}
|
|
||||||
catch (std::exception& e) {
|
|
||||||
fmt::print(stderr, "{}", e.what());
|
|
||||||
}
|
|
||||||
|
|
||||||
/* re-key */
|
|
||||||
try {
|
/* re-key */
|
||||||
const std::string nu_G_k{generate_blocks(2)};
|
const std::string nu_G_k{generate_blocks(2)};
|
||||||
|
|
||||||
/* clear out the old key and set a new one */
|
/* clear out the old key and set a new one */
|
||||||
|
@ -188,7 +184,7 @@ auto Generator::generate_random_data(const uint64_t& n) -> std::string {
|
||||||
std::memmove(G.k, nu_G_k.c_str(), G.k_length);
|
std::memmove(G.k, nu_G_k.c_str(), G.k_length);
|
||||||
}
|
}
|
||||||
catch (std::exception& e) {
|
catch (std::exception& e) {
|
||||||
fmt::print(stderr, "{}", e.what());
|
fmt::print(stderr, "{}\n", e.what());
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue