Fix LPOS when member not in list.
This commit ensures an empty List is returned in the case the member does not exist in the target list. See #1957. Original pull request: #1962.
This commit is contained in:
committed by
Mark Paluch
parent
19eb0930cd
commit
840c7f50ca
@@ -72,7 +72,7 @@ class JedisListCommands implements RedisListCommands {
|
||||
return connection.invoke().just(BinaryJedis::lpos, MultiKeyPipelineBase::lpos, key, element, params, count);
|
||||
}
|
||||
|
||||
return connection.invoke().from(BinaryJedis::lpos, MultiKeyPipelineBase::lpos, key, element, params).get(Collections::singletonList);
|
||||
return connection.invoke().from(BinaryJedis::lpos, MultiKeyPipelineBase::lpos, key, element, params).getOrElse(Collections::singletonList, Collections::emptyList);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -71,7 +71,7 @@ class LettuceListCommands implements RedisListCommands {
|
||||
return connection.invoke().just(RedisListAsyncCommands::lpos, key, element, count, args);
|
||||
}
|
||||
|
||||
return connection.invoke().from(RedisListAsyncCommands::lpos, key, element, args).get(Collections::singletonList);
|
||||
return connection.invoke().from(RedisListAsyncCommands::lpos, key, element, args).getOrElse(Collections::singletonList, Collections::emptyList);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user