Skip to content

Commit

Permalink
Don't use binary module, so eredis can be compatible with R13B04
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlion committed Jul 25, 2011
1 parent f706273 commit e777940
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ebin/*
13 changes: 7 additions & 6 deletions src/eredis_parser.erl
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,13 @@ parse_simple({incomplete_simple, OldData}, NewData0) ->
%%

get_newline_pos(B) ->
case binary:match(B, <<?NL>>) of
{Pos, _} ->
Pos;
nomatch ->
undefined
end.
[H|_] = re:split(B, ?NL),
Pos = size(H),
case Pos =:= size(B) of
true -> undefined;
false -> Pos
end.


%% @doc: Helper for handling the result of parsing. Will update the
%% parser state with the continuation of given name if necessary.
Expand Down

0 comments on commit e777940

Please sign in to comment.