Skip to content

Commit ba64973

Browse files
committed
Address review comment
1 parent fee2a97 commit ba64973

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

libs/server/Resp/Objects/ListCommands.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,4 +1030,4 @@ private unsafe bool ListBlockingPopMultiple()
10301030
return true;
10311031
}
10321032
}
1033-
}
1033+
}

libs/server/Transaction/TxnKeyManager.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,7 @@ private int ListObjectKeys(RespCommand command)
378378
RespCommand.LINSERT => SingleKey(StoreType.Object, LockType.Exclusive),
379379
RespCommand.LLEN => SingleKey(StoreType.Object, LockType.Shared),
380380
RespCommand.LMOVE => ListKeys(2, StoreType.Object, LockType.Exclusive),
381-
// Account for mandatory LEFT/RIGHT argument
382-
RespCommand.LMPOP => ListReadKeysWithCount(LockType.Exclusive, mandatoryArgs: 1),
381+
RespCommand.LMPOP => ListReadKeysWithCount(LockType.Exclusive),
383382
RespCommand.LPOP => SingleKey(StoreType.Object, LockType.Exclusive),
384383
RespCommand.LPOS => SingleKey(StoreType.Object, LockType.Shared),
385384
RespCommand.LPUSH => SingleKey(StoreType.Object, LockType.Exclusive),
@@ -488,15 +487,15 @@ private int ListKeys(int inputCount, StoreType storeType, LockType type)
488487
/// <summary>
489488
/// Returns a list of keys for LMPOP command
490489
/// </summary>
491-
private int ListReadKeysWithCount(LockType type, bool isObject = true, int mandatoryArgs = 0)
490+
private int ListReadKeysWithCount(LockType type, bool isObject = true)
492491
{
493492
if (respSession.parseState.Count == 0)
494493
return -2;
495494

496495
if (!respSession.parseState.TryGetInt(0, out var numKeys))
497496
return -2;
498497

499-
if (numKeys + mandatoryArgs + 1 > respSession.parseState.Count)
498+
if (numKeys + 1 > respSession.parseState.Count)
500499
return -2;
501500

502501
for (var i = 1; i < numKeys + 1; i++)

0 commit comments

Comments
 (0)