chore(generator): collapse 2 try-catch blocks
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-02-03 02:56:28 +01:00
parent 348b921795
commit ffd0180578
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -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
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)};
/* 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);
}
catch (std::exception& e) {
fmt::print(stderr, "{}", e.what());
fmt::print(stderr, "{}\n", e.what());
}
return r;
}