File 3422-beam_types-Slightly-optimize-join-1.patch of Package erlang

From 92ae5befec973d9c6d147d4201060a7add1264b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Wed, 24 Feb 2021 05:29:34 +0100
Subject: [PATCH 2/3] beam_types: Slightly optimize join/1

---
 lib/compiler/src/beam_types.erl | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lib/compiler/src/beam_types.erl b/lib/compiler/src/beam_types.erl
index 7559673a94..8a5f1775dd 100644
--- a/lib/compiler/src/beam_types.erl
+++ b/lib/compiler/src/beam_types.erl
@@ -180,9 +180,14 @@ mts_records(_RsA, _RsB, []) ->
 
 -spec join([type()]) -> type().
 
-join([T1, T2| Ts]) ->
-    join([join(T1, T2) | Ts]);
-join([T]) -> T.
+join([T | Ts]) ->
+    join_list(Ts, T).
+
+join_list([T | Ts], T) ->
+    join_list(Ts, T);
+join_list([T1 | Ts], T) ->
+    join_list(Ts, join(T1, T));
+join_list([], T) -> T.
 
 %% Return the "join" of Type1 and Type2, which is more general than Type1 and
 %% Type2. This is identical to lub/2 but can operate on and produce unions.
-- 
2.26.2

openSUSE Build Service is sponsored by