projects
/
euphorik.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MOD optimisation des fonctions est_une_reponse_a_user et a_repondu_a_message du modul...
[euphorik.git]
/
modules
/
erl
/
euphorik_test.erl
diff --git
a/modules/erl/euphorik_test.erl
b/modules/erl/euphorik_test.erl
index
8b8dbfb
..
b705fc6
100644
(file)
--- a/
modules/erl/euphorik_test.erl
+++ b/
modules/erl/euphorik_test.erl
@@
-73,18
+73,18
@@
mot_rand(L, Mot) ->
% Tire au hasard de 0 à 3 messages sur les 10 derniers postés, renvoie une liste de int()
% répartition :
% Tire au hasard de 0 à 3 messages sur les 10 derniers postés, renvoie une liste de int()
% répartition :
-% 0 : 0.
5
-% 1 : 0.
3
+% 0 : 0.
1
+% 1 : 0.
7
% 2 : 0.15
% 3 : 0.05
messages_id_rand() ->
R = random:uniform(),
% 2 : 0.15
% 3 : 0.05
messages_id_rand() ->
R = random:uniform(),
- if R =< 0.
5
->
+ if R =< 0.
1
->
[];
true ->
Messages = lists:map(fun(#minichat{id = Id}) -> Id end, euphorik_bd:messages(8)),
if
[];
true ->
Messages = lists:map(fun(#minichat{id = Id}) -> Id end, euphorik_bd:messages(8)),
if
- R > 0.
5
andalso R =< 0.8 ->
+ R > 0.
1
andalso R =< 0.8 ->
tire_element_rand(1, Messages);
R > 0.8 andalso R =< 0.95 ->
tire_element_rand(2, Messages);
tire_element_rand(1, Messages);
R > 0.8 andalso R =< 0.95 ->
tire_element_rand(2, Messages);