mirror of
https://github.com/openssl/openssl.git
synced 2025-01-30 14:01:55 +08:00
Optimize circular buffer to avoid modulo
CLA: trivial Avoid doing the division via modulo where possible. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/23097)
This commit is contained in:
parent
6e155858d7
commit
d6e4056805
@ -141,9 +141,10 @@ int BIO_hex_string(BIO *out, int indent, int width, const void *data,
|
||||
|
||||
BIO_printf(out, "%02X:", d[i]);
|
||||
|
||||
j = (j + 1) % width;
|
||||
if (!j)
|
||||
if (++j >= width) {
|
||||
j = 0;
|
||||
BIO_printf(out, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (i && !j)
|
||||
|
Loading…
Reference in New Issue
Block a user