Browse Source

Simplify parse_fullpath code

Loïc Hoguin 11 years ago
parent
commit
3e812cbcf0
1 changed files with 2 additions and 7 deletions
  1. 2 7
      src/cow_http.erl

+ 2 - 7
src/cow_http.erl

@@ -89,16 +89,11 @@ parse_fullpath(Fullpath) ->
 
 parse_fullpath(<<>>, Path) ->
 	{Path, <<>>};
-parse_fullpath(<< $?, Rest/binary >>, Path) ->
-	parse_fullpath_qs(Rest, Path, <<>>);
+parse_fullpath(<< $?, Qs/binary >>, Path) ->
+	{Path, Qs};
 parse_fullpath(<< C, Rest/binary >>, SoFar) ->
 	parse_fullpath(Rest, << SoFar/binary, C >>).
 
-parse_fullpath_qs(<<>>, Path, Qs) ->
-	{Path, Qs};
-parse_fullpath_qs(<< C, Rest/binary >>, Path, SoFar) ->
-	parse_fullpath_qs(Rest, Path, << SoFar/binary, C >>).
-
 -ifdef(TEST).
 parse_fullpath_test() ->
 	{<<"*">>, <<>>} = parse_fullpath(<<"*">>),