Skip to content

Commit 3113025

Browse files
committed
fix: bug in ZADD command creation
1 parent b6c6ba5 commit 3113025

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/commands/sorted-set.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export function ZADD<T extends TSchema>(
1818
if (entries.length === 0) {
1919
throw new Error("At least one entry is required");
2020
}
21-
const flatEntries: RedisValue[] = new Array(entries.length * 2);
21+
const flatEntries: RedisValue[] = [];
2222
for (const [score, value] of entries) {
23-
flatEntries.push(score);
23+
flatEntries.push(String(score));
2424
flatEntries.push(key.encode(value));
2525
}
2626
return new RedisCommand<number>(["ZADD", key.name, ...flatEntries]);

0 commit comments

Comments
 (0)