Skip to content

Commit

Permalink
set InitialCapcity to use heap effectively
Browse files Browse the repository at this point in the history
  • Loading branch information
KengoTODA committed Apr 12, 2015
1 parent a041cf4 commit 1780b6c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/redis/clients/jedis/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -396,12 +396,13 @@ public void blpop(final String[] args) {
}

public void blpop(final int timeout, final String... keys) {
List<String> args = new ArrayList<String>();
final int size = keys.length + 1;
List<String> args = new ArrayList<String>(size);
for (String arg : keys) {
args.add(arg);
}
args.add(String.valueOf(timeout));
blpop(args.toArray(new String[args.size()]));
blpop(args.toArray(new String[size]));
}

public void sort(final String key, final SortingParams sortingParameters, final String dstkey) {
Expand All @@ -421,12 +422,13 @@ public void brpop(final String[] args) {
}

public void brpop(final int timeout, final String... keys) {
List<String> args = new ArrayList<String>();
final int size = keys.length + 1;
List<String> args = new ArrayList<String>(size);
for (String arg : keys) {
args.add(arg);
}
args.add(String.valueOf(timeout));
brpop(args.toArray(new String[args.size()]));
brpop(args.toArray(new String[size]));
}

public void zcount(final String key, final double min, final double max) {
Expand Down

0 comments on commit 1780b6c

Please sign in to comment.