generator: improve iteration
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-01-14 05:40:22 +01:00
parent e0448d6d08
commit 53cde1371f
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -128,9 +128,10 @@ auto Generator::do_crypto() -> std::string {
auto Generator::generate_blocks(unsigned int k_blocks) -> std::string {
assert((G.ctr != 0) && "Counter is not 0, generator has been seeded");
std::string r{""};
for (uint i = 0; i < k_blocks; ++i) {
r += do_crypto();
while (k_blocks--) {
r += Generator::do_crypto();
++G.ctr;
}
return r;