Skip to content

Commit ff8f76d

Browse files
Merge branch 'stable'
2 parents 51586b3 + 85fcede commit ff8f76d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/gm.erl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,9 +1353,12 @@ find_common(A, B, Common) ->
13531353
find_common(A1, B1, queue:in(Val, Common));
13541354
{{empty, _A}, _} ->
13551355
{Common, B};
1356-
{_, {_, B1}} ->
1356+
%% Drop value from B.
1357+
%% Match value to avoid infinite loop, since {empty, B} = queue:out(B).
1358+
{_, {{value, _}, B1}} ->
13571359
find_common(A, B1, Common);
1358-
{{_, A1}, _} ->
1360+
%% Drop value from A. Empty A should be matched by second close.
1361+
{{{value, _}, A1}, _} ->
13591362
find_common(A1, B, Common)
13601363
end.
13611364

0 commit comments

Comments
 (0)