DATAREDIS-706 - Remove redundant null checks from JedisClusterStringCommands.set(…).

Original pull request: #278.
This commit is contained in:
Xiaohu Zhang
2017-11-16 14:58:57 +01:00
committed by Mark Paluch
parent 8930c79b9d
commit 9cf701f90e

View File

@@ -127,9 +127,9 @@ class JedisClusterStringCommands implements RedisStringCommands {
Assert.notNull(expiration, "Expiration must not be null!");
Assert.notNull(option, "Option must not be null!");
if (expiration == null || expiration.isPersistent()) {
if (expiration.isPersistent()) {
if (option == null || ObjectUtils.nullSafeEquals(SetOption.UPSERT, option)) {
if (ObjectUtils.nullSafeEquals(SetOption.UPSERT, option)) {
return set(key, value);
} else {
@@ -142,7 +142,7 @@ class JedisClusterStringCommands implements RedisStringCommands {
}
} else {
if (option == null || ObjectUtils.nullSafeEquals(SetOption.UPSERT, option)) {
if (ObjectUtils.nullSafeEquals(SetOption.UPSERT, option)) {
if (ObjectUtils.nullSafeEquals(TimeUnit.MILLISECONDS, expiration.getTimeUnit())) {
return pSetEx(key, expiration.getExpirationTime(), value);