Skip to content

Commit

Permalink
Merge pull request #66 from M6Web/feature/fix-rpoplpush-null
Browse files Browse the repository at this point in the history
fix rpoplpush, if rpop value is null, not reinsert it.
  • Loading branch information
DocRoms authored Mar 26, 2018
2 parents 20766b8 + 58f2480 commit bd2af73
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 bd2af73

Please sign in to comment.