summaryrefslogtreecommitdiff
path: root/adler32.c
diff options
context:
space:
mode:
authorNathan Moinvaziri <nathan@nathanm.com>2020-05-23 06:14:54 -0700
committerHans Kristian Rosbach <hk-github@circlestorm.org>2020-06-08 21:17:18 +0200
commit00b1a86f91052ed99f3467ab0f00e53d5f5f4ea0 (patch)
tree875d65a9f83342504381972eb577d7babc6602ae /adler32.c
parentf8801a00b02c8796c6dddde8a30adc18a1a80477 (diff)
Add UNLIKELY to first 3 branches in adler32 variants.
Diffstat (limited to 'adler32.c')
-rw-r--r--adler32.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/adler32.c b/adler32.c
index 2cd51bb..30d8886 100644
--- a/adler32.c
+++ b/adler32.c
@@ -27,15 +27,15 @@ uint32_t adler32_c(uint32_t adler, const unsigned char *buf, size_t len) {
adler &= 0xffff;
/* in case user likes doing a byte at a time, keep it fast */
- if (len == 1)
+ if (UNLIKELY(len == 1))
return adler32_len_1(adler, buf, sum2);
/* initial Adler-32 value (deferred check for len == 1 speed) */
- if (buf == NULL)
+ if (UNLIKELY(buf == NULL))
return 1L;
/* in case short lengths are provided, keep it somewhat fast */
- if (len < 16)
+ if (UNLIKELY(len < 16))
return adler32_len_16(adler, buf, len, sum2);
/* do length NMAX blocks -- requires just one modulo operation */