Skip to content

Commit

Permalink
Minor: remove empty sequence checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominique Villard committed Mar 19, 2022
1 parent 19585d4 commit 4cb4fae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
8 changes: 0 additions & 8 deletions src/main/java/redis/clients/jedis/UnifiedJedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.net.URI;
import java.time.Duration;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -3923,9 +3922,6 @@ public boolean bfExists(String key, String item) {

@Override
public List<Boolean> bfMExists(String key, String... items) {
if (items.length == 0) {
return Collections.emptyList();
}
return executeCommand(commandObjects.bfMExists(key, items));
}

Expand Down Expand Up @@ -3981,13 +3977,9 @@ public boolean cfExists(String key, String item) {

@Override
public List<Boolean> cfMExists(String key, String... items) {
if (items.length == 0) {
return Collections.emptyList();
}
return executeCommand(commandObjects.cfMExists(key, items));
}


@Override
public boolean cfDel(String key, String item) {
return executeCommand(commandObjects.cfDel(key, item));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public interface CuckooFilterCommands {
* {@code CF.MEXISTS {key} {item ...}}
*
* @param key The name of the filter
* @param items Items to check for
* @param items Items to check for (non empty sequence)
* @return a list of booleans where false if the item certainly does not exist,
* true if the item may exist.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import static org.junit.Assert.fail;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.junit.AfterClass;
Expand Down Expand Up @@ -217,8 +216,8 @@ public void insertExpansion() {
assertEquals(20, insert.size());
}

@Test
@Test(expected = JedisDataException.class)
public void testNoItemMExists() {
assertEquals(Collections.emptyList(), client.bfMExists("simpleBloom"));
client.bfMExists("simpleBloom");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ public void testExistsItemExists() {
assertEquals(Collections.singletonList(true), client.cfMExists("cuckoo17", "foo"));
}

@Test
@Test(expected = JedisDataException.class)
public void testNoItemMExists() {
assertEquals(Collections.emptyList(), client.cfMExists("cuckoo17"));
client.cfMExists("cuckoo17");
}

@Test
Expand Down

0 comments on commit 4cb4fae

Please sign in to comment.