Permalink
Browse files

Fix rpush and lpush

There's no way these were working properly before.  I guess nobody
has needed them yet.

Bonus: It fixes all of the erldis_list tests
  • Loading branch information...
1 parent a7b29fd commit f7b0fa4d2b5e2f74784d0187b80b9ae70beec3f9 @mattsta mattsta committed May 12, 2010
Showing with 5 additions and 5 deletions.
  1. +2 −2 src/erldis.erl
  2. +3 −3 src/erldis_list.erl
View
@@ -86,10 +86,10 @@ decrby(Client, Key, By) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
rpush(Client, Key, Value) ->
- erldis_client:sr_scall(Client, bulk_cmd([<<"rpush">>, Key], Value)).
+ numeric(erldis_client:sr_scall(Client, bulk_cmd([<<"rpush">>, Key], Value))).
lpush(Client, Key, Value) ->
- erldis_client:sr_scall(Client, bulk_cmd([<<"lpush">>, Key], Value)).
+ numeric(erldis_client:sr_scall(Client, bulk_cmd([<<"lpush">>, Key], Value))).
llen(Client, Key) ->
numeric(erldis_client:sr_scall(Client, inline_cmd(<<"llen">>, Key))).
View
@@ -25,10 +25,10 @@ is_empty(Key, Client) -> len(Key, Client) == 0.
len(Key, Client) -> erldis:llen(Client, Key).
in(Item, Key, Client) ->
- ok = erldis:rpush(Client, Key, Item).
+ erldis:rpush(Client, Key, Item).
in_r(Item, Key, Client) ->
- ok = erldis:lpush(Client, Key, Item).
+ erldis:lpush(Client, Key, Item).
out(Key, Client) ->
case erldis:lpop(Client, Key) of
@@ -232,4 +232,4 @@ reverse(Key, Client) -> foldl(fun(Item, L) -> [Item | L] end, [], Key, Client).
% filter
% map
-% member
+% member

0 comments on commit f7b0fa4

Please sign in to comment.