Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparison function is error for struct host_t #50

Open
MatthewButterfly opened this issue Apr 18, 2017 · 1 comment
Open

Comparison function is error for struct host_t #50

MatthewButterfly opened this issue Apr 18, 2017 · 1 comment

Comments

@MatthewButterfly
Copy link

Below code in cluster_pool.h is to define less operator for host_t. The class host_t is used as key in a map.
I think the implemetion has a error.
Below two redis host are different address, they should be as different values and can be inserted into a map. But the current implemention will treat them as the same value ,since the port are the same, the less function will return false.
Please have a look at it.
redis1 : address: 192.168.10.10, port: 6379
redis2 : address: 192.168.10.11, prot: 6379

inline bool operator < (const host_t& rvalue) const
{
      return (address <= rvalue.address) && ( port < rvalue.port);
}
@luca3m
Copy link
Owner

luca3m commented Jul 4, 2017

You're right, by the way the cluster implementation is pretty experimental and uncomplete at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants