Skip to content

Commit 82aa785

Browse files
committed
refactor: calculate maxPageSize only once on multi-key operations #30
1 parent c75796e commit 82aa785

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

adapter.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,10 @@ function getKeys(scan, matcher, count) {
271271

272272
function getValues({ get, mget }, store, count, hashSlot) {
273273
const prefix = `${createKey(store, '', hashSlot).split('_').shift()}_`
274+
count = maxPageSize(count, hashSlot)
274275

275276
return function (keys) {
276277
function page(keys, values) {
277-
count = maxPageSize(count, hashSlot)
278-
279278
const nKeys = keys.splice(0, count)
280279
return Async.of()
281280
/**
@@ -320,9 +319,9 @@ function getValues({ get, mget }, store, count, hashSlot) {
320319

321320
function deleteKeys(del, count, hashSlot) {
322321
return function (keys) {
323-
function page(keys) {
324-
count = maxPageSize(count, hashSlot)
322+
count = maxPageSize(count, hashSlot)
325323

324+
function page(keys) {
326325
const nKeys = keys.splice(0, count)
327326
return Async.of()
328327
/**

0 commit comments

Comments
 (0)