diff options
author | Emile Joubert <emile@rabbitmq.com> | 2011-09-27 18:00:00 +0100 |
---|---|---|
committer | Emile Joubert <emile@rabbitmq.com> | 2011-09-27 18:00:00 +0100 |
commit | cff0b0f380223b1ea7f1336f53ed62ee430deb85 (patch) | |
tree | 43f765df4eac38101f4fa4a68ab0822c329c6fc1 /src/rabbit_backing_queue_qc.erl | |
parent | 2ca36a53d41ab837f22901774d0e1c1dcceaf806 (diff) | |
download | rabbitmq-server-cff0b0f380223b1ea7f1336f53ed62ee430deb85.tar.gz |
Refactor
Making use of the symmetry between q3 and q4
Diffstat (limited to 'src/rabbit_backing_queue_qc.erl')
-rw-r--r-- | src/rabbit_backing_queue_qc.erl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/rabbit_backing_queue_qc.erl b/src/rabbit_backing_queue_qc.erl index d6b17771..a8cfe6ba 100644 --- a/src/rabbit_backing_queue_qc.erl +++ b/src/rabbit_backing_queue_qc.erl @@ -383,10 +383,12 @@ qc_test_queue(Durable) -> rand_choice([]) -> []; rand_choice(List) -> rand_choice(List, [], random:uniform(length(List))). -rand_choice(_List, Selection, 0) -> Selection; -rand_choice(List, Selection, N) -> Picked = lists:nth(random:uniform(length(List)), List), - rand_choice(List -- [Picked], - [Picked | Selection], N - 1). +rand_choice(_List, Selection, 0) -> + Selection; +rand_choice(List, Selection, N) -> + Picked = lists:nth(random:uniform(length(List)), List), + rand_choice(List -- [Picked], [Picked | Selection], + N - 1). dropfun(Props) -> Expiry = eval({call, erlang, element, |