aboutsummaryrefslogtreecommitdiffstats
path: root/src/cow_http.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-10-22 14:16:45 +0200
committerLoïc Hoguin <[email protected]>2013-10-22 14:16:45 +0200
commit3e812cbcf08868c7eefbf584d0e1f2e6c0b5f1e5 (patch)
tree1fdea6db27a0ed521b1611d643d19ef6982c5264 /src/cow_http.erl
parent2f35af5b0a67f591dde5ae4305a9587988a37c0c (diff)
downloadcowlib-3e812cbcf08868c7eefbf584d0e1f2e6c0b5f1e5.tar.gz
cowlib-3e812cbcf08868c7eefbf584d0e1f2e6c0b5f1e5.tar.bz2
cowlib-3e812cbcf08868c7eefbf584d0e1f2e6c0b5f1e5.zip
Simplify parse_fullpath code
Diffstat (limited to 'src/cow_http.erl')
-rw-r--r--src/cow_http.erl9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/cow_http.erl b/src/cow_http.erl
index 704933b..5e8fa22 100644
--- a/src/cow_http.erl
+++ b/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(<<"*">>),