Neopallium / lua-zmq

Lua zeromq2 binding
http://github.com/Neopallium/lua-zmq
MIT License
153 stars 36 forks source link

poller resize #43

Closed moteus closed 11 years ago

moteus commented 11 years ago
static int poller_resize_items(ZMQ_Poller *poller, int len) {
  int old_len = poller->len;
  /* make sure new length is atleast as large as items count. */
  len = (poller->count <= len) ? len : poller->count;
  /* if the new length is the same as the old length, then don't try to resize. */
  if(old_len == len) return len;

We should use

len = (old_len <= len) ? len : old_len;
Neopallium commented 11 years ago

The way it is now will allow shrinking the items list. Right now the resize function is only called to grow the list when more room is needed, but that might change in the future.