comparison src/event/ngx_event_quic_transport.c @ 8206:ad7ca043edf5 quic

QUIC: microoptimization in varint parsing. Removed a useless mask from the value being shifted, since it is 1-byte wide.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 13 Nov 2020 13:24:45 +0000
parents 831d1960826f
children 46374c3fee3f
comparison
equal deleted inserted replaced
8205:ef83990f0e25 8206:ad7ca043edf5
158 if (pos >= end) { 158 if (pos >= end) {
159 return NULL; 159 return NULL;
160 } 160 }
161 161
162 p = pos; 162 p = pos;
163 len = 1 << ((*p & 0xc0) >> 6); 163 len = 1 << (*p >> 6);
164 164
165 value = *p++ & 0x3f; 165 value = *p++ & 0x3f;
166 166
167 if ((size_t)(end - p) < (len - 1)) { 167 if ((size_t)(end - p) < (len - 1)) {
168 return NULL; 168 return NULL;