openresty / lua-resty-balancer

A generic consistent hash implementation for OpenResty/Lua
322 stars 77 forks source link

try use table.clone copy table #30

Closed juzipeek closed 4 years ago

juzipeek commented 4 years ago

we can use luajit's table.clone func create a new nodes.

spacewander commented 4 years ago

@juzipeek Please take a look at the failed test cases.

juzipeek commented 4 years ago

@juzipeek Please take a look at the failed test cases.

  1. new pull request change the test cases.
  2. add OSX's dlib build support.
spacewander commented 4 years ago

add OSX's dlib build support.

Please don't hijack the PR with another feature. We need to separate each feature in their own pull request.

doujiang24 commented 4 years ago

@juzipeek thanks for your contribution, it looks good to me except these following comments:

  1. as @spacewander said, we need to separate each feature in their own pull request.
  2. we'd better not change the existing test case when the library behavior doesn't change.
spacewander commented 4 years ago

@doujiang24 The behavior is changed slightly, since the order of the hash table is different between table.copy and manual copying.

doujiang24 commented 4 years ago

@juzipeek Thanks for your contribution, merged by splitting into two PRs. https://github.com/openresty/lua-resty-balancer/pull/34 https://github.com/openresty/lua-resty-balancer/pull/33