aboutsummaryrefslogtreecommitdiffstats
path: root/src/cow_http_hd.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-12-20 15:12:23 +0200
committerLoïc Hoguin <[email protected]>2014-12-20 15:12:23 +0200
commit3dd7a84f495d8f4af50425a136743f67583248ba (patch)
treebae6694889b40ea3b72f91a9fe294d646f29b038 /src/cow_http_hd.erl
parentc72c11bc583aec2a4250e78439ed335bcfc552c6 (diff)
downloadcowlib-3dd7a84f495d8f4af50425a136743f67583248ba.tar.gz
cowlib-3dd7a84f495d8f4af50425a136743f67583248ba.tar.bz2
cowlib-3dd7a84f495d8f4af50425a136743f67583248ba.zip
Speed up the two slowest properties in cow_http_hd
We limit input to 50 items maximum.
Diffstat (limited to 'src/cow_http_hd.erl')
-rw-r--r--src/cow_http_hd.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cow_http_hd.erl b/src/cow_http_hd.erl
index 9023add..8b39dbe 100644
--- a/src/cow_http_hd.erl
+++ b/src/cow_http_hd.erl
@@ -284,7 +284,7 @@ accept() ->
prop_parse_accept() ->
?FORALL(L,
- non_empty(list(accept())),
+ vector(1, 50, accept()),
begin
<< _, Accept/binary >> = iolist_to_binary([[$,, A] || {_, _, _, _, _, A} <- L]),
ResL = parse_accept(Accept),
@@ -1689,7 +1689,7 @@ ws_extension() ->
prop_parse_sec_websocket_extensions() ->
?FORALL(L,
- non_empty(list(ws_extension())),
+ vector(1, 50, ws_extension()),
begin
<< _, SecWebsocketExtensions/binary >> = iolist_to_binary([[$,, E] || {_, _, E} <- L]),
ResL = parse_sec_websocket_extensions(SecWebsocketExtensions),