Skip to content

Commit

Permalink
INTERNAL: remove reverse local variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
brido4125 authored and jhpark816 committed Dec 20, 2024
1 parent 10af6fe commit b0d8af8
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/main/java/net/spy/memcached/ArcusClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2505,32 +2505,28 @@ public void gotData(String bkey, int flags, byte[] data, byte[] eflag) {
public CollectionFuture<Map<Integer, Element<Object>>> asyncBopGetByPosition(
String key, BTreeOrder order, int pos) {
BTreeGetByPosition get = new BTreeGetByPosition(order, pos);
boolean reverse = false;
return asyncBopGetByPosition(key, get, reverse, collectionTranscoder);
return asyncBopGetByPosition(key, get, collectionTranscoder);
}

@Override
public <T> CollectionFuture<Map<Integer, Element<T>>> asyncBopGetByPosition(
String key, BTreeOrder order, int pos, Transcoder<T> tc) {
BTreeGetByPosition get = new BTreeGetByPosition(order, pos);
boolean reverse = false;
return asyncBopGetByPosition(key, get, reverse, tc);
return asyncBopGetByPosition(key, get, tc);
}

@Override
public CollectionFuture<Map<Integer, Element<Object>>> asyncBopGetByPosition(
String key, BTreeOrder order, int from, int to) {
BTreeGetByPosition get = new BTreeGetByPosition(order, from, to);
boolean reverse = from > to;
return asyncBopGetByPosition(key, get, reverse, collectionTranscoder);
return asyncBopGetByPosition(key, get, collectionTranscoder);
}

@Override
public <T> CollectionFuture<Map<Integer, Element<T>>> asyncBopGetByPosition(
String key, BTreeOrder order, int from, int to, Transcoder<T> tc) {
BTreeGetByPosition get = new BTreeGetByPosition(order, from, to);
boolean reverse = from > to;
return asyncBopGetByPosition(key, get, reverse, tc);
return asyncBopGetByPosition(key, get, tc);
}

/**
Expand All @@ -2539,13 +2535,11 @@ public <T> CollectionFuture<Map<Integer, Element<T>>> asyncBopGetByPosition(
*
* @param k b+tree item's key
* @param get operation parameters (element position and so on)
* @param reverse forward or backward
* @param tc transcoder to serialize and unserialize value
* @return future holding the map of the fetched element and its position
*/
private <T> CollectionFuture<Map<Integer, Element<T>>> asyncBopGetByPosition(
final String k, final BTreeGetByPosition get,
final boolean reverse, final Transcoder<T> tc) {
final String k, final BTreeGetByPosition get, final Transcoder<T> tc) {
// Check for invalid arguments (not to get CLIENT_ERROR)
if (get.getOrder() == null) {
throw new IllegalArgumentException("BTreeOrder must not be null.");
Expand All @@ -2562,7 +2556,7 @@ private <T> CollectionFuture<Map<Integer, Element<T>>> asyncBopGetByPosition(
private final HashMap<Integer, Entry<BKeyObject, CachedData>> cachedDataMap =
new HashMap<>();
private final GetResult<Map<Integer, Element<T>>> result =
new BopGetByPositionResultImpl<>(cachedDataMap, reverse, tc);
new BopGetByPositionResultImpl<>(cachedDataMap, get.isReversed(), tc);

public void receivedStatus(OperationStatus status) {
CollectionOperationStatus cstatus;
Expand Down

0 comments on commit b0d8af8

Please sign in to comment.