Skip to content

Commit 4e9f32e

Browse files
committed
refactor(resp): 优化RESP对象创建逻辑
- 修改newInstance方法参数从byte类型改为ByteBuffer类型 - 在解析SimpleStrings时增加对"OK"字符串的快速返回处理 - 重构SimpleStrings类,增加OK_RESP静态实例用于快速匹配 - 调整Redisun类中对SimpleStrings.OK的判断逻辑 - 更新Arrays和Maps类中元素创建方式 - 优化RedisMessageProcessor中RESP实例创建流程
1 parent 623e468 commit 4e9f32e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/tech/smartboot/redisun/Redisun.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ public CompletableFuture<Boolean> asyncSet(String key, String value, Consumer<Se
395395
if (resp == SimpleStrings.OK_RESP) {
396396
return true;
397397
} else if (resp instanceof SimpleStrings) {
398-
return false;
398+
return SimpleStrings.OK.equals(resp.getValue());
399399
} else if (resp instanceof Nulls) {
400400
return false;
401401
} else {

0 commit comments

Comments
 (0)