Closed bunnyyiu closed 11 years ago
Do you have an example call where this breaks? As the .apply allows a array of servers to be pushed.
Here is the example call. var hashring = require('hashring');
var ring = new hashring([ '192.168.0.102:11212', '192.168.0.103:11212', '192.168.0.104:11212']); ring.addServer('192.168.0.105:11212'); //break here ring.addServer(['192.168.0.105:11212']); //this work fine
I think it is better ignore my pull request and change the description in README.md as below is fine. ring.addServer(['192.168.0.102:11212']);
I was gonna implement the same argument format as the constructor, which would be a relatively easy fix. Would that help you out :)?
That's good, I like your argument format in constructor.
Fixed in master by using the connection-parse
library
Should use Array.prototype.push.call instead of Array.prototype.push.apply.