http: websocket: avoid modulo for power of 2
even for the small cases this can matter Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
c70d98c90c
commit
42b6f4331f
@ -114,7 +114,7 @@ fn mask_bytes(mask: Option<[u8; 4]>, data: &mut [u8]) {
|
||||
|
||||
if data.len() < 32 {
|
||||
for i in 0..data.len() {
|
||||
data[i] ^= mask[i % 4];
|
||||
data[i] ^= mask[i & 3];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user