Problem: irregular loop conditions

Solution: use standard loop constructs and optimize some loops
This commit is contained in:
Simon Giesecke
2019-12-24 16:39:04 +01:00
parent 628adf1cb7
commit f8f7913737
10 changed files with 72 additions and 57 deletions

View File

@@ -117,7 +117,8 @@ void zmq::ws_encoder_t::size_ready ()
static_cast<unsigned char *> (_masked_msg.data ());
unsigned char *src =
static_cast<unsigned char *> (in_progress ()->data ());
for (size_t i = 0; i < in_progress ()->size (); ++i, mask_index++)
for (size_t i = 0, size = in_progress ()->size (); i < size;
++i, mask_index++)
dest[i] = src[i] ^ _mask[mask_index % 4];
next_step (_masked_msg.data (), _masked_msg.size (),