File 0135-Fix-warnings-in-ets-test-suite.patch of Package erlang
From f79f2ee9f3a2f813647ded38d463dd1f04d8846e Mon Sep 17 00:00:00 2001
From: Maria Scott <maria-12648430@hnc-agency.org>
Date: Tue, 19 Dec 2023 10:32:40 +0100
Subject: [PATCH] Fix warnings in ets test suite
---
lib/stdlib/test/ets_SUITE.erl | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl
index a4105a3c81..aeda6e4e78 100644
--- a/lib/stdlib/test/ets_SUITE.erl
+++ b/lib/stdlib/test/ets_SUITE.erl
@@ -281,14 +281,11 @@ end_per_group(benchmark, Config) ->
EtsProcess = proplists:get_value(ets_benchmark_result_summary_tab_process, Config),
Report =
fun(NOfBenchmarksCtr, TotThroughputCtr, Name) ->
- Average =
- case {ets:lookup_element(T, TotThroughputCtr, 2),
- ets:lookup_element(T, NOfBenchmarksCtr, 2)} of
- {0.0, 0.0} ->
- 0;
- {TotThrp, NBench} ->
- TotThrp / NBench
- end,
+ NBench = ets:lookup_element(T, NOfBenchmarksCtr, 2),
+ Average = if
+ NBench == 0 -> 0;
+ true -> ets:lookup_element(T, TotThroughputCtr, 2) / NBench
+ end,
io:format("~p ~p~n", [Name, Average]),
ct_event:notify(
#event{name = benchmark_data,
@@ -4380,7 +4377,7 @@ lem_data() ->
lem_crash(T) ->
L = ets:lookup_element(T, 'eddie2@boromir', 3),
- {erlang:phash(L, 256), L}.
+ {erlang:phash2(L, 256), L}.
lem_crash_3(T) ->
lem_crash(T),
--
2.35.3