NewLife/NewLife.Redis

[fix]修正HyperLogLog.Merge对Key前缀的支持
大石头 authored at 2024-08-27 11:23:32 大石头 committed at 2024-08-27 13:25:21
6ec0e88
Tree
1 Parent(s) 67b82a1
Summary: 1 changed files with 4 additions and 1 deletions.
Modified +4 -1
Modified +4 -1
diff --git a/NewLife.Redis/HyperLogLog.cs b/NewLife.Redis/HyperLogLog.cs
index 0d8d217..3d9f5a3 100644
--- a/NewLife.Redis/HyperLogLog.cs
+++ b/NewLife.Redis/HyperLogLog.cs
@@ -60,7 +60,10 @@ public class HyperLogLog : RedisBase
         };
         foreach (var item in keys)
         {
-            args.Add(item);
+            if (Redis is FullRedis rds && !rds.Prefix.IsNullOrEmpty())
+                args.Add(item.EnsureStart(rds.Prefix));
+            else
+                args.Add(item);
         }
         return Execute((rc, k) => rc.Execute<String>("PFMERGE", args.ToArray()), true) == "OK";
     }