Projects >> redis-protocol >>2edaa12e64ae6300016f2f2304ab6568c5943d77

Chunk
Conflicting content
   */
  @Override
  public IntegerReply zcount(byte[] key0, byte[] min1, byte[] max2) throws RedisException {
<<<<<<< HEAD
    ZSet zset = _getzset(key0, false);
    Iterable entries = zset.subSet(_todouble(min1), _todouble(max2));
=======
    if (key0 == null || min1 == null || max2 == null) {
      throw new RedisException("wrong number of arguments for 'zcount' command");
    }
    BytesKeyZSet zset = _getzset(key0, false);
    Score min = _toscorerange(min1);
    Score max = _toscorerange(max2);
    NavigableSet entries = zset.subSet(new ZSetEntry(null, min.value), true,
            new ZSetEntry(null, max.value), true);
>>>>>>> a77a021e71dbced481778b81eaedfb9ccbaf65a9
    int total = 0;
    for (ZSetEntry entry : entries) {
      if (entry.getScore() == min.value && !min.inclusive) {
Solution content
   */
  @Override
  public IntegerReply zcount(byte[] key0, byte[] min1, byte[] max2) throws RedisException {
    if (key0 == null || min1 == null || max2 == null) {
      throw new RedisException("wrong number of arguments for 'zcount' command");
    }
    ZSet zset = _getzset(key0, false);
    Score min = _toscorerange(min1);
    Score max = _toscorerange(max2);
    Iterable entries = zset.subSet(_todouble(min1), _todouble(max2));
    int total = 0;
    for (ZSetEntry entry : entries) {
      if (entry.getScore() == min.value && !min.inclusive) {
File
SimpleRedisServer.java
Developer's decision
Combination
Kind of conflict
If statement
Method invocation
Variable
Chunk
Conflicting content
        throw new RedisException("wrong number of arguments for '" + name + "' command");
      }
    }
<<<<<<< HEAD
    ZSet destination = _getzset(args[0], true);
    for (int i = 2; i < numkeys + 2; i++) {
      ZSet zset = _getzset(args[i], false);
      if (i == 2) {
=======
    del(new byte[][] { destination0 });
    BytesKeyZSet destination = _getzset(destination0, true);
    for (int i = 0; i < numkeys; i++) {
      BytesKeyZSet zset = _getzset(key2[i], false);
      if (i == 0) {
>>>>>>> a77a021e71dbced481778b81eaedfb9ccbaf65a9
        if (weights == null) {
          destination.addAll(zset);
        } else {
Solution content
        throw new RedisException("wrong number of arguments for '" + name + "' command");
      }
    }
    del(new byte[][] { destination0 });
    ZSet destination = _getzset(destination0, true);
    for (int i = 0; i < numkeys; i++) {
      ZSet zset = _getzset(key2[i], false);
      if (i == 0) {
        if (weights == null) {
          destination.addAll(zset);
        } else {
File
SimpleRedisServer.java
Developer's decision
Manual
Kind of conflict
For statement
If statement
Method invocation
Variable
Chunk
Conflicting content
        for (ZSetEntry entry : iterable) {
          BytesKey key = entry.getValue();
          ZSetEntry current = zset.get(key);
<<<<<<< HEAD
          destination.remove(entry.getValue());
          if (current != null) {
            double newscore = entry.getScore() * (weights == null ? 1 : weights[i - 2]);
=======
          destination.remove(entry);
          if (union || current != null) {
            double newscore = entry.getScore() * (weights == null ? 1 : weights[i]);
>>>>>>> a77a021e71dbced481778b81eaedfb9ccbaf65a9
            if (type == null || type == Aggregate.SUM) {
              if (current != null) {
                newscore += current.getScore();
Solution content
        for (ZSetEntry entry : iterable) {
          BytesKey key = entry.getValue();
          ZSetEntry current = zset.get(key);
          destination.remove(entry.getValue());
          if (union || current != null) {
            double newscore = entry.getScore() * (weights == null ? 1 : weights[i]);
            if (type == null || type == Aggregate.SUM) {
              if (current != null) {
                newscore += current.getScore();
File
SimpleRedisServer.java
Developer's decision
Combination
Kind of conflict
Array access
If statement
Method invocation
Variable