mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-24 04:25:10 -07:00
Micro-optimization
This commit is contained in:
parent
e2fca8cac5
commit
3822caf6c7
@ -515,11 +515,11 @@ void
|
||||
sodium_increment(unsigned char *n, const size_t nlen)
|
||||
{
|
||||
size_t i;
|
||||
unsigned int c = 1U;
|
||||
unsigned int c = 1U << 8;
|
||||
|
||||
for (i = (size_t) 0U; i < nlen; i++) {
|
||||
c >>= 8;
|
||||
c += n[i];
|
||||
n[i] = (unsigned char) c;
|
||||
c >>= 8;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user