Skip to content

Commit

Permalink
fix rpoplpush, if rpop value is null, not reinsert it.
Browse files Browse the repository at this point in the history
  • Loading branch information
Romuald PRIOL committed Mar 23, 2018
1 parent 20766b8 commit 58f2480
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/M6Web/Component/RedisMock/RedisMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,9 @@ public function rpoplpush(string $sourceList, string $destinationList)
$rpopValue = $this->rpop($sourceList);

// LPUSH (send the value at the end of the $destinationList)
$this->lpush($destinationList, $rpopValue);
if (null !== $rpopValue){
$this->lpush($destinationList, $rpopValue);
}

// return the rpop value;
return $rpopValue;
Expand Down

0 comments on commit 58f2480

Please sign in to comment.