Merge pull request #330 from zhupan/master

Sharded Performance improvement
This commit is contained in:
Jonathan Leibiusky
2012-08-13 07:25:28 -07:00

View File

@@ -77,7 +77,7 @@ public class Sharded<R, S extends ShardInfo<R>> {
public S getShardInfo(byte[] key) {
SortedMap<Long, S> tail = nodes.tailMap(algo.hash(key));
if (tail.size() == 0) {
if (tail.isEmpty()) {
return nodes.get(nodes.firstKey());
}
return tail.get(tail.firstKey());