mirror of
https://git.proxmox.com/git/proxmox
synced 2025-08-05 11:30:46 +00:00
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 {
|
if data.len() < 32 {
|
||||||
for i in 0..data.len() {
|
for i in 0..data.len() {
|
||||||
data[i] ^= mask[i % 4];
|
data[i] ^= mask[i & 3];
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user