From 1964bf15a44fa0a59edf5f423c195f3bcd76aeb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=BA=E8=83=BD=E5=A4=A7=E7=9F=B3=E5=A4=B4?= Date: Mon, 5 May 2025 07:15:08 +0800 Subject: [PATCH] [fix] HINCRBYFLOAT --- NewLife.Redis/FullRedis.cs | 2 +- NewLife.Redis/RedisHash.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NewLife.Redis/FullRedis.cs b/NewLife.Redis/FullRedis.cs index 8b00465..bddfb03 100644 --- a/NewLife.Redis/FullRedis.cs +++ b/NewLife.Redis/FullRedis.cs @@ -884,7 +884,7 @@ public class FullRedis : Redis /// public virtual T? BRPOP(String key, Int32 secTimeout = 0) { - var rs = BRPOP(new[] { key }, secTimeout); + var rs = BRPOP([key], secTimeout); return rs == null ? default : rs.Item2; } diff --git a/NewLife.Redis/RedisHash.cs b/NewLife.Redis/RedisHash.cs index 7cd92cb..92a77fc 100644 --- a/NewLife.Redis/RedisHash.cs +++ b/NewLife.Redis/RedisHash.cs @@ -25,10 +25,10 @@ public class RedisHash : RedisBase, IDictionary Boolean ICollection>.IsReadOnly => false; /// 获取所有键 - public ICollection Keys => Execute((r, k) => r.Execute("HKEYS", Key)) ?? new TKey[0]; + public ICollection Keys => Execute((r, k) => r.Execute("HKEYS", Key)) ?? []; /// 获取所有值 - public ICollection Values => Execute((r, k) => r.Execute("HVALS", Key)) ?? new TValue[0]; + public ICollection Values => Execute((r, k) => r.Execute("HVALS", Key)) ?? []; /// 获取 或 设置 指定键的值 /// @@ -181,7 +181,7 @@ public class RedisHash : RedisBase, IDictionary /// /// /// - public Double HIncrBy(TKey field, Double value) => Execute((r, k) => r.Execute("HINCRBY", Key, field, value), true); + public Double HIncrBy(TKey field, Double value) => Execute((r, k) => r.Execute("HINCRBYFLOAT", Key, field, value), true); /// 只在 key 指定的哈希集中不存在指定的字段时,设置字段的值 ///