Browse Source

Speed up the two slowest properties in cow_http_hd

We limit input to 50 items maximum.
Loïc Hoguin 10 years ago
parent
commit
3dd7a84f49
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/cow_http_hd.erl

+ 2 - 2
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),