Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Improvement: collection itteration, invoke performance methods, remove unnecesssary constructor #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/net/spy/memcached/MemcachedClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1758,7 +1758,7 @@ public void receivedStatus(OperationStatus s) {
// XXX: Potential abstraction leak.
// The handling of incr/decr in the binary protocol
// Allows us to avoid string processing.
rv.set(new Long(s.isSuccess() ? s.getMessage() : "-1"));
rv.set(Long.valueOf(s.isSuccess() ? s.getMessage() : "-1"));
}

@Override
Expand Down Expand Up @@ -1993,7 +1993,7 @@ private OperationFuture<Long> asyncMutate(Mutator m, String key, long by,
new OperationCallback() {
@Override
public void receivedStatus(OperationStatus s) {
rv.set(new Long(s.isSuccess() ? s.getMessage() : "-1"), s);
rv.set(Long.valueOf(s.isSuccess() ? s.getMessage() : "-1"), s);
}

@Override
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/net/spy/memcached/compat/SpyObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ public class SpyObject extends Object {

private transient Logger logger = null;

/**
* Get an instance of SpyObject.
*/
public SpyObject() {
super();
}

/**
* Get a Logger instance for this class.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected int addKey(String k) {
bkeys.put(rv, KeyUtil.getKeyBytes(k));
rkeys.put(k, rv);
synchronized (vbmap) {
vbmap.put(k, new Short((short) 0));
vbmap.put(k, Short.valueOf((short) 0));
}
}
return rv;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ public ByteBuffer getBytes() {
}
if (hasVBucketCheckpoints) {
bb.putShort((short)vBucketCheckpoints.size());
for (Short vBucket : vBucketCheckpoints.keySet()) {
bb.putShort(vBucket);
bb.putLong(vBucketCheckpoints.get(vBucket));
for (Map.Entry<Short, Long> vBucket : vBucketCheckpoints.entrySet()){
bb.putShort(vBucket.getKey());
bb.putLong(vBucket.getValue());
}
}

Expand Down