diff options
author | sigsegv7 <ian@vegaa.systems> | 2023-09-17 07:25:44 -0400 |
---|---|---|
committer | sigsegv7 <ian@vegaa.systems> | 2023-09-17 07:25:44 -0400 |
commit | 3a03072abfaab683337c54922feca3d5cb096254 (patch) | |
tree | b67dd5b1c644e73af9525afdbfe49decde6855c6 /main.c | |
parent | 31ca14fd12f92a7a333a33e6d3b06c90652c6678 (diff) |
Optimize step decrementation logic
Signed-off-by: sigsegv7 <ian@vegaa.systems>
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -89,7 +89,8 @@ encrypt(char *buf, size_t buf_size) /* Ensure we don't cause any overflows */ while (((current_pos + step) >= buf_size) && step > 1) - step /= 2; + /* Essentially divide the step by 2, just faster */ + step >>= 1; } } |